結果

問題 No.188 HAPPY DAY
コンテスト
ユーザー komkomh
提出日時 2019-04-03 15:56:57
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 34 ms / 1,000 ms
+ 805µs
コード長 430 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 13,696 KB
最終ジャッジ日時 2026-10-05 15:17:56
合計ジャッジ時間 1,041 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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