結果
| 問題 | No.87 Advent Calendar Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-03 21:16:34 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 625 bytes |
| 記録 | |
| コンパイル時間 | 108 ms |
| コンパイル使用メモリ | 77,588 KB |
| 最終ジャッジ日時 | 2025-12-03 13:20:04 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 23 |
ソースコード
# -*- coding: utf-8 -*-
# メモ
# TLE解
from collections import Counter
def solve(N, start):
year = 1
day = 0
count = Counter()
for i in xrange(7):
count[i] = 0
while year <= N:
if year % 400 == 0:
day += 366
elif year % 100 == 0:
day += 365
elif year % 4 == 0:
day += 366
else:
day += 365
if year > start:
count[day % 7] += 1
year += 1
return count
if __name__ == '__main__':
N = int(raw_input())
c = solve(N, 2014)
print c[3]