結果
問題 | No.87 Advent Calendar Problem |
ユーザー |
|
提出日時 | 2015-07-09 14:22:29 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 10 ms / 5,000 ms |
コード長 | 377 bytes |
コンパイル時間 | 226 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-08 01:46:50 |
合計ジャッジ時間 | 1,367 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#!/usr/bin/pythonfrom datetime import datetimefrom itertools import countn = int(raw_input())yy = 2014md = 7, 23x = datetime(yy, *md).weekday()arr = []for y in count(yy+1):d = datetime(y, *md).weekday()arr.append(d)if (y - yy) % 400 == 0 and d == x:breaksz = len(arr)p, q = divmod(n-yy, sz)res = arr.count(x) * p + arr[:q].count(x)print res