結果

問題 No.1185 完全な3の倍数
ユーザー roarisroaris
提出日時 2020-08-22 16:36:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 77,972 KB
最終ジャッジ日時 2023-08-16 00:28:45
合計ジャッジ時間 7,636 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
77,772 KB
testcase_01 AC 128 ms
77,664 KB
testcase_02 AC 126 ms
77,772 KB
testcase_03 AC 147 ms
77,540 KB
testcase_04 AC 145 ms
77,828 KB
testcase_05 AC 144 ms
77,792 KB
testcase_06 AC 145 ms
77,504 KB
testcase_07 AC 148 ms
77,452 KB
testcase_08 AC 147 ms
77,476 KB
testcase_09 AC 126 ms
77,568 KB
testcase_10 AC 127 ms
77,644 KB
testcase_11 AC 126 ms
77,436 KB
testcase_12 AC 128 ms
77,708 KB
testcase_13 AC 127 ms
77,580 KB
testcase_14 AC 128 ms
77,720 KB
testcase_15 AC 127 ms
77,592 KB
testcase_16 AC 125 ms
77,580 KB
testcase_17 AC 128 ms
77,628 KB
testcase_18 AC 129 ms
77,760 KB
testcase_19 AC 146 ms
77,416 KB
testcase_20 AC 146 ms
77,428 KB
testcase_21 AC 147 ms
77,532 KB
testcase_22 AC 143 ms
77,548 KB
testcase_23 AC 146 ms
77,508 KB
testcase_24 AC 145 ms
77,584 KB
testcase_25 AC 141 ms
77,520 KB
testcase_26 AC 144 ms
77,568 KB
testcase_27 AC 146 ms
77,512 KB
testcase_28 AC 145 ms
77,564 KB
testcase_29 AC 150 ms
77,452 KB
testcase_30 AC 150 ms
77,608 KB
testcase_31 AC 143 ms
77,176 KB
testcase_32 AC 149 ms
77,760 KB
testcase_33 AC 141 ms
77,404 KB
testcase_34 AC 144 ms
77,612 KB
testcase_35 AC 149 ms
77,972 KB
testcase_36 AC 142 ms
77,516 KB
testcase_37 AC 145 ms
77,568 KB
testcase_38 AC 145 ms
77,616 KB
testcase_39 AC 131 ms
77,580 KB
testcase_40 AC 126 ms
77,640 KB
testcase_41 AC 133 ms
77,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def dfs(d, now):
    global ans
    
    if d==10:
        if 10<=now<=N:
            ans += 1
        return
    
    for n in [0, 3, 6, 9]:
        dfs(d+1, 10*now+n)

N = int(input())
ans = 0
dfs(0, 0)

for i in range(10, 100):
    if i%3==0 and (i//10%3!=0 or i%10%3!=0) and i<=N:
        ans += 1

print(ans)
0