結果

問題 No.726 Tree Game
ユーザー Poina15Poina15
提出日時 2018-08-24 22:22:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 13,044 KB
最終ジャッジ日時 2023-09-05 12:17:12
合計ジャッジ時間 3,261 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,944 KB
testcase_01 AC 82 ms
12,868 KB
testcase_02 AC 82 ms
12,892 KB
testcase_03 AC 82 ms
13,000 KB
testcase_04 AC 81 ms
13,004 KB
testcase_05 AC 81 ms
12,968 KB
testcase_06 AC 81 ms
12,848 KB
testcase_07 WA -
testcase_08 AC 82 ms
12,820 KB
testcase_09 WA -
testcase_10 AC 82 ms
12,864 KB
testcase_11 AC 81 ms
12,816 KB
testcase_12 AC 82 ms
13,032 KB
testcase_13 AC 81 ms
12,872 KB
testcase_14 AC 81 ms
12,924 KB
testcase_15 AC 81 ms
12,924 KB
testcase_16 AC 85 ms
12,848 KB
testcase_17 AC 84 ms
12,836 KB
testcase_18 AC 84 ms
12,820 KB
testcase_19 AC 83 ms
13,008 KB
testcase_20 AC 84 ms
12,860 KB
testcase_21 AC 83 ms
12,872 KB
testcase_22 AC 85 ms
13,000 KB
testcase_23 AC 85 ms
12,956 KB
testcase_24 AC 85 ms
12,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Y, X = map(int, input().split())
def prime(n):
    seq = list(range(2, n))
    while len(seq) > 0:
        p = seq.pop(0)
        yield p
        if n ** 0.5 >= p:
            seq = [i for i in seq if i % p != 0]
ps = set(prime(10 ** 5))

def f(v):
    for i in range(1, 10 ** 10):
        if (v + i) in ps:
            return i
        for p in ps:
            if (v + i) % p == 0:
                break
        else:
            return i
dx = f(X)
dy = f(Y)
print('Second' if (dx + dy) % 2 == 0 else 'First')
0