QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#612683 | #6697. Calandar | zqx# | RE | 0ms | 0kb | C++23 | 1008b | 2024-10-05 12:34:20 | 2024-10-05 12:34:20 |
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;
}
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
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
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