結果

問題 No.726 Tree Game
ユーザー ayaoniayaoni
提出日時 2020-12-26 15:13:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 943 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 59,480 KB
最終ジャッジ日時 2023-10-24 23:04:09
合計ジャッジ時間 2,619 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,684 KB
testcase_01 AC 36 ms
53,684 KB
testcase_02 AC 36 ms
53,684 KB
testcase_03 AC 36 ms
53,684 KB
testcase_04 AC 36 ms
53,684 KB
testcase_05 AC 36 ms
53,684 KB
testcase_06 AC 36 ms
53,684 KB
testcase_07 AC 37 ms
53,684 KB
testcase_08 AC 37 ms
53,684 KB
testcase_09 AC 37 ms
53,684 KB
testcase_10 AC 36 ms
53,684 KB
testcase_11 AC 36 ms
53,684 KB
testcase_12 AC 36 ms
53,684 KB
testcase_13 AC 36 ms
53,684 KB
testcase_14 AC 36 ms
53,684 KB
testcase_15 AC 36 ms
53,684 KB
testcase_16 AC 39 ms
57,432 KB
testcase_17 AC 40 ms
57,432 KB
testcase_18 AC 40 ms
57,432 KB
testcase_19 AC 40 ms
57,432 KB
testcase_20 AC 40 ms
57,432 KB
testcase_21 AC 39 ms
57,432 KB
testcase_22 AC 41 ms
59,480 KB
testcase_23 AC 40 ms
57,432 KB
testcase_24 AC 39 ms
57,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


Y,X = MI()


def is_prime(a):
    if a == 1:
        return False
    for i in range(2,int(a**.5)+1):
        if a % i == 0:
            return False
    return True


for i in range(Y+1,10**10):
    if is_prime(i):
        pY = i
        break

for i in range(X+1,10**10):
    if is_prime(i):
        pX = i
        break

if is_prime(X) and is_prime(Y):
    print('Second')
elif X == 2 or Y == 2:
    print('Second')
elif (pX-X+pY-Y) % 2 == 0:
    print('Second')
else:
    print('First')
0