結果
| 問題 |
No.3041 非対称じゃんけん
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 01:09:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 514 bytes |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 82,112 KB |
| 実行使用メモリ | 66,704 KB |
| 最終ジャッジ日時 | 2025-04-16 01:11:36 |
| 合計ジャッジ時間 | 3,142 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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")
lam6er