結果
| 問題 | No.726 Tree Game | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-08-24 21:35:36 | 
| 言語 | PyPy2 (7.3.15) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 508 bytes | 
| コンパイル時間 | 437 ms | 
| コンパイル使用メモリ | 76,928 KB | 
| 実行使用メモリ | 76,672 KB | 
| 最終ジャッジ日時 | 2024-06-23 06:49:40 | 
| 合計ジャッジ時間 | 3,414 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 RE * 23 | 
ソースコード
X, Y = map(int, raw_input().split())
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 is_prime(X):
    cnt += 1
    X += 1
while is_prime(Y):
    cnt += 1
    Y += 1
x = X + 1
y = Y + 1
while not is_prime(x):
    x += 1
while not is_prime(y):
    y += 1
d = x - X + y - Y
print "First" if (d + cnt) % 2 else "Second"
            
            
            
        