結果
問題 |
No.3041 非対称じゃんけん
|
ユーザー |
![]() |
提出日時 | 2025-04-16 16:49:44 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 514 bytes |
コンパイル時間 | 461 ms |
コンパイル使用メモリ | 82,148 KB |
実行使用メモリ | 66,892 KB |
最終ジャッジ日時 | 2025-04-16 16:51:21 |
合計ジャッジ時間 | 2,855 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | RE * 30 |
ソースコード
n = int(input()) if n == 0: print("No") exit() dp = [False] * (n + 1) for m in range(1, n + 1): current_s_prev = (n - m) % 2 for k in range(1, 4): if k > m: continue next_m = m - k current_s_new = (current_s_prev + k) % 2 if next_m == 0: if current_s_new == 1: dp[m] = True break else: if not dp[next_m]: dp[m] = True break print("Yes" if dp[n] else "No")