結果
| 問題 | No.87 Advent Calendar Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-23 08:44:33 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 388 bytes |
| 記録 | |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 71,536 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-12 11:57:05 |
| 合計ジャッジ時間 | 13,744 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 1 TLE * 1 -- * 22 |
ソースコード
#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;
}