結果

問題 No.1185 完全な3の倍数
ユーザー qumazakiqumazaki
提出日時 2020-09-12 02:24:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,408 KB
最終ジャッジ日時 2023-08-28 14:26:43
合計ジャッジ時間 6,710 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
77,096 KB
testcase_01 AC 91 ms
71,132 KB
testcase_02 AC 94 ms
71,456 KB
testcase_03 AC 102 ms
77,116 KB
testcase_04 AC 104 ms
77,012 KB
testcase_05 AC 104 ms
77,408 KB
testcase_06 AC 104 ms
77,012 KB
testcase_07 AC 103 ms
77,392 KB
testcase_08 AC 104 ms
77,084 KB
testcase_09 AC 89 ms
71,528 KB
testcase_10 AC 90 ms
71,560 KB
testcase_11 AC 90 ms
71,452 KB
testcase_12 AC 91 ms
71,136 KB
testcase_13 AC 91 ms
71,404 KB
testcase_14 AC 90 ms
71,576 KB
testcase_15 AC 89 ms
71,556 KB
testcase_16 AC 91 ms
71,576 KB
testcase_17 AC 90 ms
71,600 KB
testcase_18 AC 89 ms
71,604 KB
testcase_19 AC 101 ms
77,196 KB
testcase_20 AC 103 ms
76,976 KB
testcase_21 AC 102 ms
77,116 KB
testcase_22 AC 102 ms
77,200 KB
testcase_23 AC 101 ms
77,020 KB
testcase_24 AC 104 ms
77,116 KB
testcase_25 AC 98 ms
77,192 KB
testcase_26 AC 104 ms
77,108 KB
testcase_27 AC 100 ms
76,956 KB
testcase_28 AC 104 ms
77,116 KB
testcase_29 AC 103 ms
77,004 KB
testcase_30 AC 101 ms
77,024 KB
testcase_31 AC 97 ms
76,812 KB
testcase_32 AC 104 ms
77,044 KB
testcase_33 AC 99 ms
77,164 KB
testcase_34 AC 102 ms
77,116 KB
testcase_35 AC 103 ms
76,824 KB
testcase_36 AC 103 ms
77,084 KB
testcase_37 AC 102 ms
77,136 KB
testcase_38 AC 101 ms
77,016 KB
testcase_39 AC 90 ms
71,620 KB
testcase_40 AC 90 ms
71,604 KB
testcase_41 AC 92 ms
71,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n = int(input())
ans = min(100,n)//3 - 10//3

d = deque()
for i in [3,6,9]:
    for j in [0,3,6,9]:
        d.append(i*10+j)

while(True):
    i = d.popleft()
    for j in [0,3,6,9]:
        x = i*10+j
        if(x > n):
            print(ans)
            exit()
        ans += 1
        d.append(x)
0