結果
| 問題 | No.87 Advent Calendar Problem | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-09-23 08:35:36 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 372 bytes | 
| コンパイル時間 | 481 ms | 
| コンパイル使用メモリ | 54,484 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-11 15:31:28 | 
| 合計ジャッジ時間 | 65,841 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 WA * 18 | 
ソースコード
#include <iostream>
using namespace std;
int calc(int a){
  int x=0;
  if(a%4==0){
    x=1;
    if(a%100==0){
      x=0;
      if(a%400==0){
        x=1;
      }
    }
  }
  return x;
}
int main(){
  int N;
  cin>>N;
  int x=0,y=0;
  for(int i=2015; i<=N; ++i){
    x+=1;
    if(calc(i)) x+=1;
    if(x==7) x=0, y+=1;
    if(x==8) x=1;
  }
  cout<<y<<endl;
  return 0;
}
            
            
            
        