結果

問題 No.87 Advent Calendar Problem
ユーザー pluto77pluto77
提出日時 2016-04-30 11:09:23
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 382 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 76,964 KB
実行使用メモリ 78,012 KB
最終ジャッジ日時 2024-04-15 08:04:19
合計ジャッジ時間 6,731 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 179 ms
77,704 KB
testcase_01 AC 294 ms
77,624 KB
testcase_02 AC 131 ms
77,476 KB
testcase_03 AC 77 ms
75,796 KB
testcase_04 AC 78 ms
75,328 KB
testcase_05 AC 79 ms
75,392 KB
testcase_06 AC 193 ms
77,484 KB
testcase_07 AC 241 ms
77,968 KB
testcase_08 AC 171 ms
77,844 KB
testcase_09 AC 214 ms
77,732 KB
testcase_10 AC 245 ms
77,852 KB
testcase_11 AC 297 ms
77,540 KB
testcase_12 AC 333 ms
77,992 KB
testcase_13 AC 270 ms
77,564 KB
testcase_14 AC 370 ms
77,944 KB
testcase_15 AC 200 ms
77,592 KB
testcase_16 AC 99 ms
77,476 KB
testcase_17 AC 78 ms
75,296 KB
testcase_18 AC 78 ms
75,544 KB
testcase_19 AC 78 ms
75,816 KB
testcase_20 AC 253 ms
78,012 KB
testcase_21 AC 229 ms
77,432 KB
testcase_22 AC 191 ms
77,480 KB
testcase_23 AC 164 ms
77,876 KB
testcase_24 AC 181 ms
77,852 KB
testcase_25 AC 122 ms
77,984 KB
testcase_26 AC 382 ms
77,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: utf-8
##yuki_87

def leap(y):
 if y%400==0:
  return True
 if y%100==0:
  return False
 if y%4==0:
  return True
 return False
 

n=int(raw_input())

x=0
y=2014
count=0
while y<=n:
 if y+400<=n:
  y+=400
  count+=57
 if x==0:
  count+=1
 if leap(y+1)==True:
  x+=2
 elif leap(y+1)==False:
  x+=1
 x%=7
 y+=1
 
print count -1
 
0