結果
| 問題 | No.87 Advent Calendar Problem | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-05-10 17:54:18 | 
| 言語 | D (dmd 2.109.1) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 433 bytes | 
| コンパイル時間 | 2,099 ms | 
| コンパイル使用メモリ | 160,004 KB | 
| 実行使用メモリ | 10,532 KB | 
| 最終ジャッジ日時 | 2025-05-10 17:54:27 | 
| 合計ジャッジ時間 | 9,044 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | RE * 2 TLE * 1 -- * 21 | 
ソースコード
module main;
// https://ja.wikipedia.org/wiki/ツェラーの公式 より
import std;
void main()
{
	// 入力
	int N = readln.chomp.to!int;
	// 答えの計算と出力
	int zeller(int y, int m, int d)
	{
		return (y + y / 4 - y / 100 + y / 400 + (13 * m + 8) / 5 + d) % 7;
	}
	// 2014年7月23日の曜日
	int h0 = zeller(2014, 7, 23);
	int ans = 0;
	foreach (y; 2015 .. N + 1)
		ans += zeller(y, 7, 23) == h0;
	writeln(ans);
}
            
            
            
        