結果

問題 No.87 Advent Calendar Problem
ユーザー itezpaceitezpace
提出日時 2016-09-23 08:44:33
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 388 bytes
コンパイル時間 622 ms
コンパイル使用メモリ 55,404 KB
実行使用メモリ 10,140 KB
最終ジャッジ日時 2024-04-28 21:22:36
合計ジャッジ時間 16,927 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,738 ms
5,248 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

ll calc(ll a){
  ll x=0;
  if(a%4==0){
    x=1;
    if(a%100==0){
      x=0;
      if(a%400==0){
        x=1;
      }
    }
  }
  return x;
}

int main(){
  ll N;
  cin>>N;
  ll x=0,y=0;
  for(ll 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;
}
0