QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#399430 | #2826. 历史行程 | ucup-team1251 | WA | 0ms | 3724kb | C++17 | 850b | 2024-04-26 13:17:15 | 2024-04-26 13:17:17 |
Judging History
answer
#include<iostream>
using namespace std;
int mo[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
bool check(int x)
{
if((x % 4 == 0 && x % 100 != 0) || ( x % 400 != 0 ))
{
mo[2] =29;
}
else mo[2] = 28;
return 0 ;
}
int ans[3000];
int main()
{
int n ;
cin >> n;
ans[2019] = 12;
int now_m = 5, day = 1 , year = 1913 , xq = 2;
int cnt = 0 ;
while(1)
{
check(year);
day ++ ;
if(day > mo[now_m])
{
now_m ++ ;
if(now_m > 12)
{
year ++ ;
now_m = 1;
}
day = 1;
}
xq ++ ;
if(xq > 7)xq = 1;
if(year == n && now_m == 5 && xq == 7)
{
cnt ++ ;
if(cnt == 2)
{
cout << day <<endl;
return 0 ;
}
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3724kb
input:
1913
output:
13
result:
wrong answer 1st lines differ - expected: '11', found: '13'