結果
| 問題 |
No.3300 Frog Game
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-10-05 15:21:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 467 bytes |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 54,492 KB |
| 最終ジャッジ日時 | 2025-10-05 15:21:38 |
| 合計ジャッジ時間 | 2,960 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 27 |
ソースコード
N, A, B = map(int, input().split())
N -= 1
if N < B:
print("sepa")
exit()
def is_win(n):
if n <= 0:
return True
if n - A <= 0 and n - B <= 0:
return False
if n < B:
return ((n + A - 1) // A) % 2 == 1
return not is_win(n - A) or not is_win(n - B)
if is_win(N % (A + B)):
print("ryota")
exit()
if is_win((N - 2 * A) % (A + B)) and is_win((N - 2 * B) % (A + B)):
print("ryota")
exit()
print("sepa")