QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#182716#6697. Calandarucup-team004AC ✓0ms3608kbC++20738b2023-09-18 14:29:212023-09-18 14:29:22

Judging History

你现在查看的是最新测评结果

  • [2023-09-18 14:29:22]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3608kb
  • [2023-09-18 14:29:21]
  • 提交

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