結果
問題 | No.1462 最弱WEAKER |
ユーザー |
![]() |
提出日時 | 2021-04-02 21:55:04 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 329 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-12-23 19:13:21 |
合計ジャッジ時間 | 1,621 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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=1000) 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')