結果

問題 No.726 Tree Game
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-18 14:14:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 75,588 KB
最終ジャッジ日時 2023-09-11 18:10:27
合計ジャッジ時間 3,809 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,352 KB
testcase_01 AC 74 ms
71,360 KB
testcase_02 AC 75 ms
71,352 KB
testcase_03 AC 74 ms
71,456 KB
testcase_04 AC 75 ms
71,540 KB
testcase_05 AC 74 ms
71,384 KB
testcase_06 AC 75 ms
71,452 KB
testcase_07 WA -
testcase_08 AC 75 ms
71,612 KB
testcase_09 WA -
testcase_10 AC 74 ms
71,204 KB
testcase_11 AC 74 ms
71,340 KB
testcase_12 AC 73 ms
71,160 KB
testcase_13 AC 74 ms
71,364 KB
testcase_14 AC 74 ms
71,068 KB
testcase_15 AC 74 ms
71,332 KB
testcase_16 AC 76 ms
75,500 KB
testcase_17 AC 78 ms
75,356 KB
testcase_18 AC 77 ms
75,444 KB
testcase_19 AC 77 ms
75,248 KB
testcase_20 AC 78 ms
74,976 KB
testcase_21 AC 76 ms
75,588 KB
testcase_22 AC 78 ms
75,252 KB
testcase_23 AC 77 ms
75,172 KB
testcase_24 AC 78 ms
75,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def is_prime(n):
    if n == 1:
        return False

    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False

    return True

y, x = map(int, input().split())
d = 10**5
for yp in range(y+1, y+d):
    if is_prime(yp):
        break
for xp in range(x+1, x+d):
    if is_prime(xp):
        break
dx = xp-x
dy = yp-y
if (dx+dy)%2 == 0:
    print('Second')
else:
    print('First')
0