結果

問題 No.1185 完全な3の倍数
ユーザー tntn
提出日時 2022-03-10 15:57:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 361 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 77,280 KB
最終ジャッジ日時 2023-10-12 18:14:18
合計ジャッジ時間 7,660 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
76,920 KB
testcase_01 AC 75 ms
71,156 KB
testcase_02 AC 77 ms
71,304 KB
testcase_03 AC 130 ms
77,276 KB
testcase_04 AC 131 ms
76,892 KB
testcase_05 AC 132 ms
77,280 KB
testcase_06 AC 130 ms
77,032 KB
testcase_07 AC 132 ms
76,944 KB
testcase_08 AC 361 ms
77,000 KB
testcase_09 AC 78 ms
71,384 KB
testcase_10 AC 75 ms
71,352 KB
testcase_11 AC 76 ms
71,300 KB
testcase_12 AC 76 ms
71,184 KB
testcase_13 AC 76 ms
71,300 KB
testcase_14 AC 76 ms
71,460 KB
testcase_15 AC 75 ms
71,188 KB
testcase_16 AC 77 ms
71,188 KB
testcase_17 AC 77 ms
71,304 KB
testcase_18 AC 78 ms
71,328 KB
testcase_19 AC 136 ms
76,888 KB
testcase_20 AC 132 ms
76,956 KB
testcase_21 AC 132 ms
77,188 KB
testcase_22 AC 131 ms
76,968 KB
testcase_23 AC 131 ms
77,216 KB
testcase_24 AC 135 ms
77,116 KB
testcase_25 AC 101 ms
76,980 KB
testcase_26 AC 135 ms
76,968 KB
testcase_27 AC 133 ms
77,196 KB
testcase_28 AC 135 ms
76,944 KB
testcase_29 AC 134 ms
77,068 KB
testcase_30 AC 134 ms
76,752 KB
testcase_31 AC 86 ms
76,540 KB
testcase_32 AC 131 ms
77,112 KB
testcase_33 AC 99 ms
77,008 KB
testcase_34 AC 130 ms
77,004 KB
testcase_35 AC 137 ms
77,280 KB
testcase_36 AC 133 ms
77,128 KB
testcase_37 AC 131 ms
77,184 KB
testcase_38 AC 135 ms
77,172 KB
testcase_39 AC 76 ms
70,992 KB
testcase_40 AC 76 ms
70,996 KB
testcase_41 AC 85 ms
76,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
n = int(input())

cnt = 0

for i in range(10, min(100, n + 1)):
    cnt = cnt + 1 if (int(str(i)[0]) + int(str(i)[1])) % 3 == 0 and i % 3 == 0 else cnt
    
if n > 100:
    numList = ['0', '3', '6', '9']
    for j in range(4 ** len(str(n))):
        st = ''
        q = j
        for k in range(len(str(n))):
            st += numList[q % 4]
            q = (q - q % 4) // 4
        s = int(st)
        if s <= n and s > 100:
            cnt += 1
    
print(cnt)
0