結果
| 問題 | No.1185 完全な3の倍数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 14:38:54 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 535 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 310,104 KB |
| 最終ジャッジ日時 | 2026-05-04 01:07:41 |
| 合計ジャッジ時間 | 23,504 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 TLE * 1 |
ソースコード
from collections import deque
def solve():
N = int(input())
if N<=100:
return N//3-3
ans = 30
d = deque(['0','3','6','9'])
while len(d):
s = d.popleft()
if s[0]!='0':
n = int(s)
if n>100 and n<=N:
ans += 1
if len(s)<=len(str(N)):
for l in ['0','3','6','9']:
d.append(l+s)
return ans
print(solve())