結果
問題 | No.87 Advent Calendar Problem |
ユーザー |
![]() |
提出日時 | 2019-12-21 11:20:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 646 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-19 04:36:55 |
合計ジャッジ時間 | 2,076 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
import datetime import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): # 2014年7月23日(水) n = int(input()) cnt2014 = [6] * 15 + [5] * 385 p, r = divmod(n, 400) cntn = [p + 1] * (r + 1) + [p] * (399 - r) ans = 0 for i,[c0,c1] in enumerate(zip(cnt2014,cntn)): d = datetime.date(2000 + i, 7, 23) ans += (d.weekday() == 2)*(c1-c0) print(ans) main()