結果
| 問題 | No.87 Advent Calendar Problem | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-01-22 17:54:00 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,057 bytes | 
| コンパイル時間 | 613 ms | 
| コンパイル使用メモリ | 73,016 KB | 
| 実行使用メモリ | 13,824 KB | 
| 最終ジャッジ日時 | 2024-09-21 15:00:19 | 
| 合計ジャッジ時間 | 13,105 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | TLE * 1 -- * 23 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <set>
#include <sstream>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
bool uru(ll y){
  bool ret;
  if(y%4==0){
    if(y%100==0){
      if(y%400==0) ret=true;
      else ret=false;
    }
    else ret=true;
  }
  else ret=false;
  return ret;
}
int main(int argc, char const *argv[]) {
  ll y;
  cin >>y;
  int n=3;
  ll ans=0;
  ll before=2014;
  for(ll i=2015; i<=y; ++i){
    if(uru) n+=2;
    else n+=1;
    n%=7;
    if(n==3){
      ++ans;
      //cout << " " << i << endl;
      if(i-before!=7){
        cout<<"not 7:"<<before<<" , "<<i<<endl;
      }
      before=i;
    }
  }
  cout << ans << endl;
  return 0;
}
            
            
            
        