結果
| 問題 |
No.1462 最弱WEAKER
|
| コンテスト | |
| ユーザー |
c-yan
|
| 提出日時 | 2021-04-02 21:38:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 268 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 82,448 KB |
| 実行使用メモリ | 182,932 KB |
| 最終ジャッジ日時 | 2024-12-23 18:37:18 |
| 合計ジャッジ時間 | 16,030 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 1 TLE * 1 |
| other | AC * 3 RE * 12 TLE * 3 |
ソースコード
from math import log
N = int(input())
def f(n):
if n == 0:
return True
a = int(log(n, 3))
for i in range(a + 1):
if f(n - 3 ** i):
continue
return True
return False
if f(N):
print('YES')
else:
print('NO')
c-yan