結果

問題 No.188 HAPPY DAY
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-09 19:43:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 687 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 7,800 KB
最終ジャッジ日時 2023-08-30 00:12:40
合計ジャッジ時間 593 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

ans = 0
s1 = {2}
s2 = {4, 6, 9, 11}
s3 = {1, 3, 5, 7, 8, 10, 12}

for i in range(1, 13):
    if i in s1:
        for j in range(1, 29):
            temp = 0
            k = str(j)
            for c in k:
                temp += int(c)
            if temp == i:
                ans += 1
    elif i in s2:
        for j in range(1, 31):
            temp = 0
            k = str(j)
            for c in k:
                temp += int(c)
            if temp == i:
                ans += 1
    else:
        for j in range(1, 32):
            temp = 0
            k = str(j)
            for c in k:
                temp += int(c)
            if temp == i:
                ans += 1
print(ans)
0