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