結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,924 KB
testcase_01 AC 81 ms
13,008 KB
testcase_02 AC 82 ms
12,816 KB
testcase_03 AC 83 ms
12,860 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 82 ms
12,848 KB
testcase_08 WA -
testcase_09 AC 81 ms
12,848 KB
testcase_10 AC 82 ms
12,816 KB
testcase_11 AC 81 ms
12,804 KB
testcase_12 AC 81 ms
12,972 KB
testcase_13 AC 81 ms
12,992 KB
testcase_14 AC 83 ms
12,936 KB
testcase_15 AC 81 ms
12,828 KB
testcase_16 WA -
testcase_17 AC 84 ms
12,868 KB
testcase_18 WA -
testcase_19 AC 85 ms
12,824 KB
testcase_20 AC 84 ms
12,940 KB
testcase_21 AC 83 ms
12,824 KB
testcase_22 AC 85 ms
12,936 KB
testcase_23 AC 84 ms
12,792 KB
testcase_24 AC 85 ms
12,916 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(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