QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#706208#6697. Calandarfutarian#AC ✓1ms3636kbC++14827b2024-11-03 09:20:172024-11-03 09:20:18

Judging History

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

  • [2024-11-03 09:20:18]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3636kb
  • [2024-11-03 09:20:17]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
//string day[5]={"Monday","Tuesday","Wednesday","Thursday","Friday"};
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		string nowaday;
		long long y1,y2,sum;
		int m1,m2,d1,d2;
		cin>>y1>>m1>>d1>>nowaday;
		cin>>y2>>m2>>d2;
		sum=((y2-y1)*360+(m2-m1)*30+d2-d1)%5;
		//sum=abs(sum);
		//cout<<sum<<endl;
		if(nowaday=="Monday") sum+=0;
		else if(nowaday=="Tuesday")sum+=1;
		else if(nowaday=="Wednesday")sum+=2;
		else if(nowaday=="Thursday")sum+=3;
		else if(nowaday=="Friday")sum+=4;
		sum%=5;
		//cout<<sum<<endl;
		if(sum<0) sum+=5;
		if(sum==0) cout<<"Monday"<<endl;
		else if(sum==1) cout<<"Tuesday"<<endl;
		else if(sum==2) cout<<"Wednesday"<<endl;
		else if(sum==3) cout<<"Thursday"<<endl;
		else if(sum==4) cout<<"Friday"<<endl;
	}
	return 0;
}

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

详细

Test #1:

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

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: 1ms
memory: 3620kb

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