結果

問題 No.726 Tree Game
ユーザー convexineq
提出日時 2021-03-15 01:46:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 53,844 KB
最終ジャッジ日時 2024-11-06 14:37:27
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_prime(N):
    if N == 2:
        return True
    elif N&1 == 0 or N == 1:
        return False
    i = 3
    while i*i <= N:
        if N%i == 0: return False
        i += 2
    return True

a,b = map(int,input().split())

x = is_prime(a)
y = is_prime(b)

ans = 0
if x and y:
    ans = 1
elif not x and not y:
    ans = (x+y+1)%2
else:
    if y:
        a,b = b,a
    if x==2 or y==2:
        ans = 1
    else:
        ans = (x+y+1)%2
print("First" if ans==0 else "Second")
0