結果

問題 No.1185 完全な3の倍数
ユーザー rin204
提出日時 2020-08-24 17:04:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,248 KB
最終ジャッジ日時 2024-11-24 09:49:08
合計ジャッジ時間 9,777 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right
import itertools

n = int(input())
ans = [i * 3 for i in range(4, 34)]
for lst in itertools.product("0369", repeat = 9):
    num = int("".join(lst))
    if num // 100 == 0:
        continue
    ans.append(num)
ans.sort()
print(bisect_right(ans, n))
0