結果
問題 |
No.87 Advent Calendar Problem
|
ユーザー |
|
提出日時 | 2016-09-23 08:44:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 1,212 ms |
コンパイル使用メモリ | 54,264 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-11-17 17:31:43 |
合計ジャッジ時間 | 111,156 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 14 |
ソースコード
#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; }