結果
| 問題 | 
                            No.726 Tree Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Yamada
                         | 
                    
| 提出日時 | 2019-01-13 02:24:47 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 40 ms / 2,000 ms | 
| コード長 | 556 bytes | 
| コンパイル時間 | 198 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-12-23 20:18:16 | 
| 合計ジャッジ時間 | 1,935 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 | 
ソースコード
def hantei(N):
    if N < 2:
        return False
    elif N == 2:
        return True
    elif N % 2 == 0:
        return False
    for i in range(int(N**0.5/2)):
        if(N%(3+2*i) == 0):
            return False
    return True
X,Y =map(int,input().split())
X1 =X+1
Y1 =Y+1
while not(hantei(X1)) and X1 !=10**1333:
    X1 +=1
while not(hantei(Y1)) and Y1 !=10**1333:
    Y1 +=1
X1 -= X
Y1 -= Y
if hantei(X) and hantei(Y):
    print("Second")
elif X == 2 or Y == 2:
    print("Second")
elif (X1+Y1)%2 ==0:
    print("Second")
else:
    print("First")
            
            
            
        
            
Yamada