結果

問題 No.726 Tree Game
ユーザー ayaoniayaoni
提出日時 2020-12-26 15:11:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 900 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,776 KB
実行使用メモリ 57,464 KB
最終ジャッジ日時 2023-10-24 23:02:02
合計ジャッジ時間 2,466 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,724 KB
testcase_01 AC 37 ms
53,724 KB
testcase_02 AC 36 ms
53,724 KB
testcase_03 AC 36 ms
53,724 KB
testcase_04 AC 37 ms
53,724 KB
testcase_05 AC 37 ms
53,724 KB
testcase_06 AC 36 ms
53,724 KB
testcase_07 AC 36 ms
53,724 KB
testcase_08 AC 38 ms
53,724 KB
testcase_09 WA -
testcase_10 AC 36 ms
53,724 KB
testcase_11 AC 37 ms
53,724 KB
testcase_12 AC 36 ms
53,724 KB
testcase_13 AC 36 ms
53,724 KB
testcase_14 AC 37 ms
53,724 KB
testcase_15 AC 36 ms
53,724 KB
testcase_16 AC 39 ms
57,464 KB
testcase_17 AC 40 ms
57,464 KB
testcase_18 AC 39 ms
57,464 KB
testcase_19 AC 39 ms
57,464 KB
testcase_20 AC 39 ms
57,464 KB
testcase_21 AC 39 ms
57,464 KB
testcase_22 AC 40 ms
57,464 KB
testcase_23 AC 40 ms
57,464 KB
testcase_24 AC 40 ms
57,464 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 (pX-X+pY-Y) % 2 == 0:
    print('Second')
else:
    print('First')
0