結果

問題 No.188 HAPPY DAY
ユーザー yuuki1036yuuki1036
提出日時 2018-11-01 00:16:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 32 ms / 1,000 ms
コード長 424 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-30 02:25:10
合計ジャッジ時間 548 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

from datetime import date, timedelta

now = date(2015,1,1)
end = date(2015,12,31)
day_inc = timedelta(days=1)
result = 0

def split_num(n):
    if n < 10:
        return 0, n
    else:
        string = str(n)
        return int(string[0]), int(string[1])

while now <= end:
    m = now.month
    now_day = now.day
    d1, d2 = split_num(now_day)
    if m == d1 + d2:
        result += 1
    now += day_inc
    
print(result)
0