QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#612728#6697. Calandarzqx#AC ✓0ms3756kbC++231.3kb2024-10-05 12:43:062024-10-05 12:43:11

Judging History

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

  • [2024-10-05 12:43:11]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3756kb
  • [2024-10-05 12:43:06]
  • 提交

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;
/*
1000000000 1 1 Wednesday
2019 5 12
*/
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=(res2-res1)%5;(cha+=5)%=5;
   int today=(mp[str]+cha-1)%5+1;
   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";
}
/*
8
2019 5 12 Monday
2019 5 11
2019 5 12 Monday
2019 5 10 
2019 5 12 Monday
2019 5 9
2019 5 12 Monday
2019 5 8
2019 5 12 Monday
2019 5 13
2019 5 12 Monday
2019 5 13
2019 5 12 Monday
2019 5 14 
2019 5 12 Monday
2019 5 15
2019 5 12 Monday
2019 5 16
2019 5 12 Monday
2019 5 17
*/
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
}   

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3600kb

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: 3756kb

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