結果
| 問題 |
No.1462 最弱WEAKER
|
| コンテスト | |
| ユーザー |
c-yan
|
| 提出日時 | 2021-04-02 21:39:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-12-23 18:46:21 |
| 合計ジャッジ時間 | 1,660 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 2 |
| other | AC * 4 RE * 14 |
ソースコード
from sys import setrecursionlimit
from functools import lru_cache
from math import log
setrecursionlimit(10 ** 6)
N = int(input())
@lru_cache(maxsize=None)
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