結果

問題 No.1185 完全な3の倍数
ユーザー rlangevin
提出日時 2023-01-15 17:37:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 245 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 76,384 KB
最終ジャッジ日時 2024-12-29 07:11:00
合計ジャッジ時間 12,021 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *

N = int(input())
ans = 0
for i in range(10, min(100, N + 1)):
    s = str(i)
    a, b = int(s[0]), int(s[1])
    if (a + b) % 3 == 0:
        ans += 1
        
for tup in product(["3", "6", "9", "0"], repeat=10):
    n = int("".join(tup))
    if 100 < n <= N:
        ans += 1
print(ans)
0