結果

問題 No.188 HAPPY DAY
コンテスト
ユーザー しおさば
提出日時 2025-11-14 15:43:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 440 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2025-11-14 15:43:04
合計ジャッジ時間 925 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from datetime import date, timedelta
#日付を取得
start = date(2015,1,1)
end = date(2015,12,31)

current = start
counter = 0

while current <= end:
	#月と日にちの数値を取得
	month = current.month
	d_tens = current.day//10
	d_ones = current.day%10
	
	#ハッピーデイを探す
	if (month == (d_tens + d_ones)):
		counter +=1
		#翌日へ
		current += timedelta(days=1)
	else:
		current += timedelta(days=1)
	
print(counter)
0