結果
問題 | No.207 世界のなんとか |
ユーザー |
|
提出日時 | 2018-03-08 18:35:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 749 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-05 08:08:51 |
合計ジャッジ時間 | 1,330 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
A, B = map(int, input().split())# xの桁数取得def digit_num(x):for i in range(1, 12):if 10**(i-1) <= x and x < 10**i:return ibreak# 各位の数を取得する関数def num_to_pieses(x):# xの桁数n = digit_num(x)n_box = []while n != 0:n_box.append(x // 10**(n-1))m = x // 10**(n-1)x = x - (10**(n-1) * m)n -= 1return n_box# xを十進表記したときに、すくなくとも一つの桁に3が現れるような、xをチェックする関数def have_3(x):n_box = num_to_pieses(x)if 3 in n_box:return Trueelse:return Falsefor i in range(A, B+1):if i%3==0 or have_3(i):print(i)