QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#399419#2826. 历史行程ucup-team1251WA 1ms3700kbC++17873b2024-04-26 13:11:402024-04-26 13:11:41

Judging History

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

  • [2024-04-26 13:11:41]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3700kb
  • [2024-04-26 13:11:40]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#define Buff ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;

void solve()
{
	int n;
	cin >> n;

	if(n == 2019) cout << 12;
	else
	{
		int day = 3;
		for(int i = 2018; i >= n; i--)
		{
			int num = 365;
			if((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
			{
				num++;
			}
			for(int j = 1; j <= num; j++)
			{
				day = (day - 1 + 7) % 7;
			}
		}
		int cnt = 0;
		if(day == 0) cnt++;
		for(int i = 2; i <= 31; i++)
		{
			day = (day + 1) % 7;
			if(day == 0)
			{
				cnt++;
				if(cnt == 2)
				{
					cout << i << endl;
					return;
				}
			}
		}
	}
}

int main()
{
	Buff;
	int N = 1;
	//cin >> N;
	while(N--)
		solve();
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3584kb

input:

1913

output:

11

result:

ok single line: '11'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

1914

output:

10

result:

ok single line: '10'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

1915

output:

9

result:

ok single line: '9'

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3700kb

input:

1916

output:

8

result:

wrong answer 1st lines differ - expected: '14', found: '8'