結果

問題 No.1185 完全な3の倍数
ユーザー hir355hir355
提出日時 2020-08-22 13:36:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 455 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 26,836 KB
最終ジャッジ日時 2023-08-16 00:00:31
合計ジャッジ時間 11,057 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 385 ms
26,752 KB
testcase_01 AC 13 ms
7,880 KB
testcase_02 AC 14 ms
7,916 KB
testcase_03 AC 347 ms
26,732 KB
testcase_04 AC 385 ms
26,660 KB
testcase_05 AC 390 ms
26,664 KB
testcase_06 AC 376 ms
26,632 KB
testcase_07 AC 341 ms
26,676 KB
testcase_08 AC 455 ms
26,652 KB
testcase_09 AC 14 ms
7,816 KB
testcase_10 AC 13 ms
7,976 KB
testcase_11 AC 13 ms
7,812 KB
testcase_12 AC 14 ms
8,000 KB
testcase_13 AC 14 ms
7,992 KB
testcase_14 AC 15 ms
7,920 KB
testcase_15 AC 15 ms
7,920 KB
testcase_16 AC 15 ms
7,860 KB
testcase_17 AC 14 ms
7,916 KB
testcase_18 AC 13 ms
7,984 KB
testcase_19 AC 116 ms
12,812 KB
testcase_20 AC 343 ms
26,700 KB
testcase_21 AC 228 ms
17,484 KB
testcase_22 AC 142 ms
17,432 KB
testcase_23 AC 117 ms
12,748 KB
testcase_24 AC 318 ms
26,708 KB
testcase_25 AC 38 ms
9,120 KB
testcase_26 AC 224 ms
17,400 KB
testcase_27 AC 111 ms
12,880 KB
testcase_28 AC 235 ms
17,624 KB
testcase_29 AC 201 ms
17,568 KB
testcase_30 AC 227 ms
17,356 KB
testcase_31 AC 20 ms
8,288 KB
testcase_32 AC 416 ms
26,672 KB
testcase_33 AC 85 ms
12,008 KB
testcase_34 AC 364 ms
26,676 KB
testcase_35 AC 409 ms
26,712 KB
testcase_36 AC 367 ms
26,760 KB
testcase_37 AC 339 ms
26,836 KB
testcase_38 AC 235 ms
17,404 KB
testcase_39 AC 14 ms
7,816 KB
testcase_40 AC 14 ms
7,912 KB
testcase_41 AC 16 ms
7,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l = [15, 24, 42, 51, 18, 27, 45, 54, 72, 81, 12, 21, 84, 75, 57, 48, 87, 78]
n = int(input())
s = [0]
st = set()
while s:
    p = s.pop()
    if p in st or p > n:
        continue
    l.append(p)
    st.add(p)
    s.append(p * 10)
    s.append(p * 10 + 3)
    s.append(p * 10 + 6)
    s.append(p * 10 + 9)
ans = 0
for x in l:
    if 10 <= x <= n:
        ans += 1
print(ans)
0