結果

問題 No.87 Advent Calendar Problem
ユーザー cureskol
提出日時 2022-08-23 13:53:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-10 21:27:42
合計ジャッジ時間 1,794 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import datetime

N=int(input())

A=datetime.date(2014, 7, 23).weekday()

cnt=0
for y in range(2015,2015+400):
  B=datetime.date(y, 7, 23).weekday()
  if A==B:
    cnt+=1

ans=0
now=2**30

while now>0:
  if 2014+now*400<=N:
    ans+=now*cnt
    N-=now*400
  now//=2

for y in range(2015,N+1):
  B=datetime.date(y, 7, 23).weekday()
  if A==B:
    ans+=1

print(ans)
0