結果

問題 No.3300 Frog Game
ユーザー 👑 loop0919
提出日時 2025-10-05 15:07:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 80,520 KB
最終ジャッジ日時 2025-10-05 15:07:57
合計ジャッジ時間 3,110 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 31 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N, A, B = map(int, input().split())
N -= 1

if N <= B:
    print("sepa")
    exit()


def is_win(n):
    if n - A <= 0 and n - B <= 0:
        return False
    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")

print("sepa")
0