QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#469557#6697. CalandarYangHyyyAC ✓1ms3836kbC++23788b2024-07-09 20:09:452024-07-09 20:09:45

Judging History

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

  • [2024-07-09 20:09:45]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3836kb
  • [2024-07-09 20:09:45]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
string ss[5]={"Monday","Tuesday","Wednesday","Thursday","Friday"};
signed main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int a,b,c,x,y,z;
		string s;
		cin>>a>>b>>c>>s>>x>>y>>z;
        int n=0,m=0;
        n+=a*360%5+b*30%5+c;
        m+=x*360%5+y*30%5+z;
        int sum=abs(n-m);int xx;
        if(n>=m)
        {
            for(int i=0;i<5;i++)
            {
                if(s==ss[i])
                    xx=((i-sum)%5+5)%5;
            }
            cout<<ss[xx]<<endl;
        }
        else{
             for(int i=0;i<5;i++)
            {
                if(s==ss[i])
                    xx=(i+sum)%5;
            }
            cout<<ss[xx]<<endl;
        }
    }	
	return 0;
}

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

詳細信息

Test #1:

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

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

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