結果

問題 No.87 Advent Calendar Problem
ユーザー itezpaceitezpace
提出日時 2016-08-02 07:52:06
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 627 ms
コンパイル使用メモリ 54,520 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-06 23:35:14
合計ジャッジ時間 99,338 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  int x,y;
  x=0;
  y=0;
  for(int i=2015; i<=n; ++i){
    int d;
    d=365;
    if(i%4==0){
      if(i%100==0){
        if(i%400==0){
          d=366;
        }
      } else {
        d=366;
      }
    }
    x+=d%7;
    if(x==0) y++;
    else if(x%7==0) y++;
  }
  cout<<y<<endl;
  return 0;
}
0