結果
問題 | No.1465 Archaea |
ユーザー | sgsw |
提出日時 | 2021-05-05 19:24:21 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 836 bytes |
コンパイル時間 | 81 ms |
コンパイル使用メモリ | 10,836 KB |
実行使用メモリ | 78,584 KB |
最終ジャッジ日時 | 2023-10-11 13:37:14 |
合計ジャッジ時間 | 4,225 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
7,968 KB |
testcase_01 | AC | 16 ms
7,808 KB |
testcase_02 | AC | 30 ms
10,156 KB |
testcase_03 | AC | 17 ms
7,840 KB |
testcase_04 | WA | - |
testcase_05 | AC | 16 ms
7,840 KB |
testcase_06 | AC | 16 ms
7,828 KB |
testcase_07 | AC | 258 ms
42,152 KB |
testcase_08 | WA | - |
testcase_09 | AC | 24 ms
9,296 KB |
testcase_10 | AC | 16 ms
7,844 KB |
testcase_11 | AC | 328 ms
49,728 KB |
testcase_12 | WA | - |
testcase_13 | RE | - |
testcase_14 | AC | 54 ms
13,380 KB |
testcase_15 | AC | 17 ms
7,832 KB |
testcase_16 | AC | 16 ms
7,864 KB |
testcase_17 | AC | 16 ms
8,516 KB |
testcase_18 | AC | 15 ms
7,772 KB |
testcase_19 | AC | 15 ms
7,840 KB |
testcase_20 | AC | 15 ms
8,288 KB |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | AC | 15 ms
7,804 KB |
ソースコード
import sys def input(): return sys.stdin.readline().rstrip() """ Do not get stuck on a problem for more than 20 minutes Just check the editorial :) There should be something else to do insead """ memo = dict() def possible(N,K): if (N,K) in memo: return memo[(N,K)] if N <= 0: return False if K == 0: res = bool(N == 1) memo[(N,K)] = res return res #N > 0 K > 0 if N % 2 == 0: res = possible(N//2,K - 1) | possible(N - 3,K - 1) else: res = possible(N - 3,K - 1) memo[(N,K)] = res return res def slv(): n,k = map(int,input().split()) if possible(n,k): print("YES") else: print("NO") return def main(): t = 1 for i in range(t): slv() return if __name__ == "__main__": main()