結果

問題 No.1185 完全な3の倍数
ユーザー 👑 KazunKazun
提出日時 2020-08-22 14:09:25
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 344 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 82,584 KB
実行使用メモリ 245,828 KB
最終ジャッジ日時 2024-04-23 08:32:53
合計ジャッジ時間 7,214 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 491 ms
115,972 KB
testcase_01 AC 34 ms
52,588 KB
testcase_02 AC 33 ms
53,076 KB
testcase_03 AC 502 ms
109,172 KB
testcase_04 AC 500 ms
109,164 KB
testcase_05 AC 495 ms
108,956 KB
testcase_06 AC 505 ms
109,096 KB
testcase_07 AC 500 ms
109,296 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#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