結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2018-03-02 16:07:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 26 ms / 1,000 ms |
コード長 | 451 bytes |
コンパイル時間 | 638 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-06-11 14:54:10 |
合計ジャッジ時間 | 616 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#-*- coding:utf-8 -*-import mathdef _is_happyday(month, day):if month == _sum_digit(day):return Truereturn Falsedef _sum_digit(n):d2 = math.floor(n/10)d1 = n - d2*10return d1 + d2if __name__ == "__main__":count = 0calenders = {1:31, 2:28, 3:31, 4:30, 5:31, 6:30, 7:31, 8:31, 9:30, 10:31, 11:30, 12:31}for month in calenders:for i in range(1, calenders[month]+1):if _is_happyday(month, i):count += 1print(count)