QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#469399 | #6697. Calandar | zzisjtu# | AC ✓ | 0ms | 3552kb | C++23 | 1.6kb | 2024-07-09 18:41:25 | 2024-07-09 18:41:25 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
#define lowbit(i) ((i)&(-i))
#define pii pair<int,int>
#define endl '\n'
#define mk(x,y) make_pair(x,y)
#define popcount(x) __builtin_popcount(x)
const double pi=3.14159265358979323846;
const double eps=1e-9;
const int inf=1e9;
const long long INF=4e18;
const int mod=1e9+7;
using namespace std;
const int N=1e5+10;
map<string,int>mp;
void solve()
{
int y1,m1,d1;
string s1;
cin>>y1>>m1>>d1>>s1;
int y2,m2,d2;
// cout<<s1<<endl;
cin>>y2>>m2>>d2;
ll ans=mp[s1];
// cout<<ans<<endl;
int y=y2-y1;
int m=m2-m1;
int d=d2-d1;
ans+=1ll*y*30*12;
ans%=5;
ans+=1ll*m*30;
ans%=5;
ans+=d;
ans%=5;
// cout<<ans<<endl;
if(ans>=0){
if(ans==0){
cout<<"Monday\n";
}
else if(ans==1){
cout<<"Tuesday\n";
}
else if(ans==2){
cout<<"Wednesday\n";
}
else if(ans==3){
cout<<"Thursday\n";
}
else if(ans==4){
cout<<"Friday\n";
}
}
else {
if(ans==-4){
cout<<"Tuesday\n";
}
else if(ans==-3){
cout<<"Wednesday\n";
}
else if(ans==-2){
cout<<"Thursday\n";
}
else if(ans==-1){
cout<<"Friday\n";
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
mp["Monday"]=0;
mp["Tuesday"]=1;
mp["Wednesday"]=2;
mp["Thursday"]=3;
mp["Friday"]=4;
int T=1;
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: 3552kb
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: 3548kb
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