結果

問題 No.715 集合と二人ゲーム
ユーザー maspymaspy
提出日時 2020-03-31 15:00:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 974 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 58,376 KB
最終ジャッジ日時 2023-09-06 22:21:26
合計ジャッジ時間 16,862 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 170 ms
8,672 KB
testcase_01 AC 167 ms
9,000 KB
testcase_02 AC 169 ms
9,240 KB
testcase_03 AC 170 ms
9,612 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 164 ms
8,740 KB
testcase_36 AC 165 ms
8,804 KB
testcase_37 AC 165 ms
8,716 KB
testcase_38 AC 167 ms
8,776 KB
testcase_39 AC 166 ms
8,780 KB
testcase_40 AC 165 ms
8,896 KB
testcase_41 AC 166 ms
8,904 KB
testcase_42 AC 167 ms
8,840 KB
testcase_43 AC 166 ms
8,840 KB
testcase_44 AC 167 ms
8,928 KB
testcase_45 AC 165 ms
8,804 KB
testcase_46 AC 166 ms
8,904 KB
testcase_47 AC 165 ms
8,784 KB
testcase_48 AC 168 ms
8,792 KB
testcase_49 AC 166 ms
8,904 KB
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from functools import lru_cache


@lru_cache(None)
def G(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    if n == 2:
        return 1
    nums = []
    nums.append(G(n - 2))
    for k in range(3, n + 1):
        nums.append(G(k - 3) ^ G(n - k))
    g = 0
    nums = set(nums)
    while g in nums:
        g += 1
    return g


U = 1000
G = [G(n) for n in range(U)]

"""
from matplotlib import pyplot as plt
plt.figure(figsize=(16,4))
plt.plot(range(300), A[:300])
"""

N = int(readline())
A = sorted(map(int, read().split()))
nums = []
prev = -10
n = 0
for x in A:
    if x == prev + 1:
        n += 1
    else:
        nums.append(n)
        n = 1
    prev = x
nums.append(n)

xor = 0
for n in nums:
    if n < U:
        xor ^= G[n]
    else:
        xor ^= G(n % 34 + 340)
print('First' if xor else 'Second')
0