QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#399430#2826. 历史行程ucup-team1251WA 0ms3724kbC++17850b2024-04-26 13:17:152024-04-26 13:17:17

Judging History

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

  • [2024-04-26 13:17:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3724kb
  • [2024-04-26 13:17:15]
  • 提交

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'