QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#612688 | #6697. Calandar | zqx# | WA | 1ms | 3792kb | C++23 | 1.0kb | 2024-10-05 12:35:02 | 2024-10-05 12:35:03 |
Judging History
answer
#include<bits/stdc++.h>
#define AC return 0;
#define int long long
#define pii pair<int,int>
#define all(tar) tar.begian(),tar.end()
const int maxx=2e5+5;
const int mod=998244353;
using namespace std;
int n,m,t;
int zh(int year,int mon,int day){
int res=year*12*30+mon*30+day;
return res;
}
map<string,int>mp;
void solve(){
int year,mon,day;
string str;
cin>>year>>mon>>day>>str;
int res1=zh(year,mon,day);
cin>>year>>mon>>day;
int res2=zh(year,mon,day);
int cha=abs(res1-res2);
int today=(mp[str]+cha-1)%5+1;
if(res1>res2) today=6-today;
if(today==1) cout<<"Monday\n";
else if(today==2) cout<<"Tuesday\n";
else if(today==3) cout<<"Wednesday\n";
else if(today==4) cout<<"Thursday\n";
else cout<<"Friday\n";
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;cin>>T;
mp["Monday"]=1;mp["Tuesday"]=2;mp["Wednesday"]=3;mp["Thursday"]=4;mp["Friday"]=5;
while(T--){
solve();
}
AC
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3604kb
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: -100
Wrong Answer
time: 0ms
memory: 3792kb
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 Wednesday Monday Monday Friday Friday Thursday Monday Monday Friday Tuesday Thursday Monday Wednesday Monday Tuesday Monday Wednesday Thursday Monday Thursday Tuesday Friday Tuesday Friday Monday Monday Thursday Monday Wednesday Wednesday Wednesday Monday Friday Tuesday Wednesday Frid...
result:
wrong answer 3rd lines differ - expected: 'Friday', found: 'Wednesday'