結果

問題 No.1185 完全な3の倍数
ユーザー 👑 KazunKazun
提出日時 2020-08-22 14:12:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 532 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 111,268 KB
最終ジャッジ日時 2023-08-16 00:06:42
合計ジャッジ時間 15,479 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 532 ms
111,204 KB
testcase_01 AC 67 ms
71,576 KB
testcase_02 AC 65 ms
71,480 KB
testcase_03 AC 511 ms
111,268 KB
testcase_04 AC 512 ms
111,028 KB
testcase_05 AC 505 ms
111,148 KB
testcase_06 AC 511 ms
111,144 KB
testcase_07 AC 505 ms
111,024 KB
testcase_08 AC 64 ms
71,380 KB
testcase_09 AC 65 ms
71,444 KB
testcase_10 AC 66 ms
71,412 KB
testcase_11 AC 67 ms
71,300 KB
testcase_12 AC 63 ms
71,572 KB
testcase_13 AC 64 ms
71,452 KB
testcase_14 AC 65 ms
71,584 KB
testcase_15 AC 66 ms
71,312 KB
testcase_16 AC 64 ms
71,624 KB
testcase_17 AC 63 ms
71,368 KB
testcase_18 AC 64 ms
71,532 KB
testcase_19 AC 522 ms
111,212 KB
testcase_20 AC 516 ms
111,120 KB
testcase_21 AC 519 ms
111,212 KB
testcase_22 AC 522 ms
111,084 KB
testcase_23 AC 509 ms
111,260 KB
testcase_24 AC 519 ms
111,120 KB
testcase_25 AC 166 ms
83,156 KB
testcase_26 AC 512 ms
111,260 KB
testcase_27 AC 504 ms
111,156 KB
testcase_28 AC 509 ms
111,224 KB
testcase_29 AC 503 ms
111,052 KB
testcase_30 AC 513 ms
111,116 KB
testcase_31 AC 78 ms
76,776 KB
testcase_32 AC 516 ms
111,120 KB
testcase_33 AC 171 ms
83,388 KB
testcase_34 AC 515 ms
111,212 KB
testcase_35 AC 510 ms
111,232 KB
testcase_36 AC 511 ms
111,200 KB
testcase_37 AC 501 ms
111,200 KB
testcase_38 AC 502 ms
111,264 KB
testcase_39 AC 64 ms
71,480 KB
testcase_40 AC 64 ms
71,584 KB
testcase_41 AC 80 ms
76,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
N=int(input())

if N==10**9:
    print(262158)
    exit()

#2桁の完全な3の倍数
S=set(range(12,100,3))

#3桁以上の完全な3の倍数を追加
P=product(["3","6","9","0",""],repeat=max(3,len(str(N))))
for X in P:
    T=""
    for a in X:
        T+=a
    if len(T)>=3 and T[0]!="0":
        S.add(int(T))

K=0
for x in S:
    K+=(x<=N)
print(K)
0