結果

問題 No.1185 完全な3の倍数
ユーザー 👑 H20H20
提出日時 2020-11-18 13:05:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 526 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 863 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 222,092 KB
最終ジャッジ日時 2023-09-30 15:00:32
合計ジャッジ時間 9,395 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 189 ms
114,760 KB
testcase_01 AC 73 ms
71,364 KB
testcase_02 AC 73 ms
71,444 KB
testcase_03 AC 191 ms
114,800 KB
testcase_04 AC 192 ms
114,848 KB
testcase_05 AC 193 ms
114,736 KB
testcase_06 AC 190 ms
114,260 KB
testcase_07 AC 190 ms
114,516 KB
testcase_08 AC 526 ms
222,092 KB
testcase_09 AC 71 ms
71,448 KB
testcase_10 AC 70 ms
71,520 KB
testcase_11 AC 72 ms
71,384 KB
testcase_12 AC 72 ms
71,392 KB
testcase_13 AC 71 ms
71,696 KB
testcase_14 AC 72 ms
71,248 KB
testcase_15 AC 70 ms
71,224 KB
testcase_16 AC 71 ms
71,516 KB
testcase_17 AC 71 ms
71,384 KB
testcase_18 AC 71 ms
71,620 KB
testcase_19 AC 188 ms
114,636 KB
testcase_20 AC 188 ms
114,648 KB
testcase_21 AC 190 ms
114,580 KB
testcase_22 AC 188 ms
114,580 KB
testcase_23 AC 187 ms
114,584 KB
testcase_24 AC 188 ms
114,636 KB
testcase_25 AC 105 ms
87,696 KB
testcase_26 AC 187 ms
114,756 KB
testcase_27 AC 188 ms
114,556 KB
testcase_28 AC 189 ms
114,516 KB
testcase_29 AC 195 ms
114,640 KB
testcase_30 AC 191 ms
114,664 KB
testcase_31 AC 82 ms
77,004 KB
testcase_32 AC 189 ms
114,272 KB
testcase_33 AC 108 ms
87,732 KB
testcase_34 AC 187 ms
114,764 KB
testcase_35 AC 189 ms
114,760 KB
testcase_36 AC 189 ms
114,584 KB
testcase_37 AC 188 ms
114,640 KB
testcase_38 AC 189 ms
114,764 KB
testcase_39 AC 72 ms
71,524 KB
testcase_40 AC 73 ms
71,688 KB
testcase_41 AC 80 ms
76,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N = int(input())
cnt = 0
T =  list(itertools.product(['0', '3', '6', '9'], repeat=len(str(N))))
for i in range(len(T)):
    num = int(''.join(T[i]))
    if num>10 and num<=N:
        cnt += 1

for i in range(10,min(100,N+1)):
    a,b = i//10 ,i%10
    if((a+b)%3==0 and a%3 != 0):
        cnt +=1

print(cnt)
0