結果
問題 | No.87 Advent Calendar Problem |
ユーザー |
![]() |
提出日時 | 2020-01-02 08:54:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 5,000 ms |
コード長 | 646 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-22 17:41:44 |
合計ジャッジ時間 | 1,803 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
import datetimeimport syssys.setrecursionlimit(10 ** 6)int1 = lambda x: int(x) - 1p2D = 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] * 385p, r = divmod(n, 400)cntn = [p + 1] * (r + 1) + [p] * (399 - r)ans = 0for i,[c0,c1] in enumerate(zip(cnt2014,cntn)):d = datetime.date(2000 + i, 7, 23)ans += (d.weekday() == 2)*(c1-c0)print(ans)main()