結果

問題 No.1185 完全な3の倍数
ユーザー souhei gunji
提出日時 2021-03-07 16:09:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 409 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-10-08 23:21:51
合計ジャッジ時間 6,964 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://yukicoder.me/problems/no/1185
from decimal import Decimal
from itertools import combinations

N = Decimal(input().strip())
count = 0
i = 12
while i <= N:
    if i % 3 != 0:
        i += 1
        continue

    l = list(combinations(str(i), 2))

    tf = True
    for j in l:
        if sum(list(map(int, j))) % 3 != 0:
            tf = False

    if tf:
        count += 1

    i += 1

print(count)
0