結果

問題 No.1849 Three Times Value
ユーザー AEnAEn
提出日時 2022-05-11 23:55:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,152 KB
最終ジャッジ日時 2023-09-26 15:51:14
合計ジャッジ時間 4,610 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,476 KB
testcase_01 AC 72 ms
71,296 KB
testcase_02 AC 79 ms
76,780 KB
testcase_03 AC 73 ms
71,412 KB
testcase_04 AC 75 ms
71,312 KB
testcase_05 AC 77 ms
71,424 KB
testcase_06 AC 105 ms
77,068 KB
testcase_07 AC 73 ms
71,292 KB
testcase_08 AC 73 ms
71,372 KB
testcase_09 AC 102 ms
77,100 KB
testcase_10 AC 100 ms
76,996 KB
testcase_11 AC 101 ms
77,128 KB
testcase_12 AC 101 ms
77,124 KB
testcase_13 AC 84 ms
76,500 KB
testcase_14 AC 83 ms
76,692 KB
testcase_15 AC 87 ms
76,620 KB
testcase_16 AC 108 ms
77,152 KB
testcase_17 AC 84 ms
76,528 KB
testcase_18 AC 72 ms
71,536 KB
testcase_19 AC 72 ms
71,596 KB
testcase_20 AC 77 ms
71,308 KB
testcase_21 AC 75 ms
71,216 KB
testcase_22 AC 73 ms
71,484 KB
testcase_23 AC 74 ms
71,496 KB
testcase_24 AC 81 ms
76,580 KB
testcase_25 AC 74 ms
71,352 KB
testcase_26 AC 85 ms
76,680 KB
testcase_27 AC 84 ms
76,788 KB
testcase_28 AC 72 ms
71,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

N = int(input())
cnt = 0
num = [str(i) for i in range(10)]
for i in range(3, 16, 3):
    if len(str(N)) < i:
        break
    for v in product(num, repeat = i//3):
        if v[0] == '0':
            continue
        s = ''.join(v)
        s = 3 * s
        if int(s)<=N:
            cnt += 1
print(cnt)
0