結果

問題 No.188 HAPPY DAY
ユーザー dashi_dragons
提出日時 2017-02-09 17:44:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 37 ms / 1,000 ms
コード長 459 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-31 01:20:05
合計ジャッジ時間 942 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

def check_happy(M,D):

	return M == D // 10 + D % 10


Y = 2015
cnt = 0

if Y % 4 == 0 and Y % 100 != 0:
	lim = {1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}	

elif Y % 100 == 0 and Y % 400 != 0:
	lim = {1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}		
else:
	lim = {1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}	

for M in lim:
	for D in range(1,lim[M]+1):
		if check_happy(M,D):
			cnt += 1

print(cnt)
0