結果
| 問題 | No.87 Advent Calendar Problem | 
| コンテスト | |
| ユーザー |  古寺いろは | 
| 提出日時 | 2015-04-12 16:54:05 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 480 bytes | 
| コンパイル時間 | 1,335 ms | 
| コンパイル使用メモリ | 157,688 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-04 13:57:39 | 
| 合計ジャッジ時間 | 2,028 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main(){
	long long N;
	cin >> N;
	//N = 2014 + 2800;
	long long day = 0;
	long long nokori = N - 2014;
	long long ans = 0;
	long long mul = nokori / 2800;
	ans += mul * 399;
	nokori %= 2800;
	for (int i = 0; i < nokori; i++)
	{
		int y = 2015 + i;
		if (y % 400 == 0) day += 366;
		else if (y % 100 == 0) day += 365;
		else if (y % 4 == 0) day += 366;
		else day += 365;
		if (day % 7 == 0) ans ++;
	}
	cout << ans << endl;
}
            
            
            
        