結果

問題 No.726 Tree Game
ユーザー titia
提出日時 2025-02-15 03:02:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-02-15 03:02:43
合計ジャッジ時間 8,972 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

X,Y=map(int,input().split())

if X>Y:
    X,Y=Y,X

XP=1
YP=1

x=X
y=Y
for i in range(2,10**6):
    while x%i==0 and x!=i:
        XP=0
        x//=i
    while y%i==0 and y!=i:
        YP=0
        y//=i


if X==1 and Y==1:
    print("Second")
elif X==1:
    if Y%2==0:
        print("Second")
    else:
        print("First")
elif X==2 or Y==2:
    print("Second")
elif XP==1 and YP==1:
    print("Second")
else:
    if X%2==Y%2:
        print("Second")
    else:
        print("First")
    
    
0