QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#182716 | #6697. Calandar | ucup-team004 | AC ✓ | 0ms | 3608kb | C++20 | 738b | 2023-09-18 14:29:21 | 2023-09-18 14:29:22 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
std::string day[5] {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
};
void solve() {
int y1, m1, d1;
std::cin >> y1 >> m1 >> d1;
std::string s;
std::cin >> s;
int x = std::find(day, day + 5, s) - day;
int y2, m2, d2;
std::cin >> y2 >> m2 >> d2;
int pass = (y2 - y1) % 5 * 360 + (m2 - m1) * 30 + (d2 - d1);
int y = (x + pass % 5 + 5) % 5;
std::cout << day[y] << "\n";
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3608kb
input:
4 2019 5 12 Monday 2019 5 14 2019 5 12 Tuesday 2019 12 30 2019 5 12 Friday 1000000000 1 1 1000000000 1 1 Wednesday 2019 5 12
output:
Wednesday Friday Thursday Thursday
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
100 60523000 9 6 Tuesday 667062297 1 19 818045248 9 22 Wednesday 950448235 4 11 347752308 10 25 Thursday 18640223 2 6 740295050 11 22 Wednesday 185496318 7 25 905846973 3 14 Tuesday 132078200 7 11 748835058 9 22 Wednesday 863118887 3 24 225924970 2 17 Wednesday 807058915 11 19 326750305 4 30 Wednesd...
output:
Friday Tuesday Friday Monday Thursday Friday Friday Thursday Monday Monday Friday Tuesday Thursday Monday Friday Friday Wednesday Monday Tuesday Thursday Wednesday Thursday Friday Tuesday Tuesday Friday Monday Tuesday Thursday Monday Tuesday Wednesday Wednesday Monday Thursday Wednesday Wednesday Fr...
result:
ok 100 lines