QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#253943 | #6697. Calandar | Lionel_ZQY# | AC ✓ | 0ms | 3592kb | C++20 | 952b | 2023-11-17 20:34:25 | 2023-11-17 20:34:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve(){
i64 y0,m0,d0,y1,m1,d1;
string s0;
cin>>y0>>m0>>d0>>s0;
cin>>y1>>m1>>d1;
i64 c=(y0-y1)*360LL+(m0-m1)*30LL+(d0-d1);
if(c==0){
cout<<s0<<'\n';
return;
}
int ok=(c>0?-1:1);
c=abs(c);
i64 n0=0;
if(s0=="Monday"){
n0=0;
}else if(s0=="Tuesday"){
n0=1;
}else if(s0=="Wednesday"){
n0=2;
}else if(s0=="Thursday"){
n0=3;
}else if(s0=="Friday"){
n0=4;
}
c%=5;
// cout<<n0<<' '<<c<<'\n';
if(ok==1){
n0=(n0+c)%5;
}else{
n0=(n0-c+5)%5;
}
// cout<<n0<<'\n';
if(n0==0){
cout<<"Monday\n";
}else if(n0==1){
cout<<"Tuesday\n";
}else if(n0==2){
cout<<"Wednesday\n";
}else if(n0==3){
cout<<"Thursday\n";
}else if(n0==4){
cout<<"Friday\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int t;
cin>>t;
while(t--){
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
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: 3592kb
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