結果

問題 No.188 HAPPY DAY
ユーザー komkomhkomkomh
提出日時 2019-04-03 15:56:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 9,652 KB
最終ジャッジ日時 2023-08-23 11:20:02
合計ジャッジ時間 703 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
9,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import datetime


def getHappyNumber(day: int):
    strDay = str(day)
    sum = 0
    for i in range(len(strDay)):
        sum += int(strDay[i])
    return sum


current = datetime.datetime.strptime('2015/01/01', '%Y/%m/%d')
count = 0
while current.year == 2015:
    current = current + datetime.timedelta(days=1)
    happyNumber = getHappyNumber(current.day)
    if current.month == happyNumber:
        count += 1

print(count)
0