QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#399419 | #2826. 历史行程 | ucup-team1251 | WA | 1ms | 3700kb | C++17 | 873b | 2024-04-26 13:11:40 | 2024-04-26 13:11:41 |
Judging History
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'