結果

問題 No.726 Tree Game
ユーザー nebukuro09
提出日時 2018-08-24 21:32:58
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 76,800 KB
実行使用メモリ 76,352 KB
最終ジャッジ日時 2024-06-23 06:45:23
合計ジャッジ時間 3,408 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y = map(int, raw_input().split())
x = X + 1
y = Y + 1

def is_prime(n):
    if n == 1:
        return False
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

if is_prime(X) and is_prime(Y):
    print "Second"
    exit()


while not is_prime(x):
    x += 1

while not is_prime(y):
    y += 1

d = x - X + y - Y
print "First" if d % 2 else "Second"
0