結果

問題 No.715 集合と二人ゲーム
ユーザー mkawa2mkawa2
提出日時 2022-01-25 15:44:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 1,302 bytes
コンパイル時間 908 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 66,868 KB
最終ジャッジ日時 2023-08-22 09:59:48
合計ジャッジ時間 9,339 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,080 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
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 WA -
testcase_31 RE -
testcase_32 AC 49 ms
14,616 KB
testcase_33 RE -
testcase_34 WA -
testcase_35 AC 16 ms
8,156 KB
testcase_36 AC 16 ms
7,980 KB
testcase_37 AC 16 ms
7,980 KB
testcase_38 AC 16 ms
8,028 KB
testcase_39 AC 16 ms
8,008 KB
testcase_40 AC 17 ms
8,032 KB
testcase_41 AC 16 ms
7,976 KB
testcase_42 AC 16 ms
8,044 KB
testcase_43 AC 17 ms
8,060 KB
testcase_44 AC 16 ms
8,036 KB
testcase_45 AC 16 ms
8,116 KB
testcase_46 AC 17 ms
8,104 KB
testcase_47 AC 17 ms
8,116 KB
testcase_48 AC 17 ms
8,112 KB
testcase_49 AC 16 ms
8,008 KB
testcase_50 RE -
testcase_51 AC 293 ms
66,660 KB
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 AC 259 ms
56,272 KB
testcase_58 WA -
testcase_59 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = 18446744073709551615
inf = 4294967295
# md = 10**9+7
md = 998244353

pre = [0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 0, 5, 2, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 2, 7, 4, 0, 1, 1, 2,
       0, 3, 1, 1]
gg = [0, 3, 3, 2, 2, 4, 4, 5, 5, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 3, 7, 4, 8, 1, 1, 2, 0, 3, 1, 1]

def grundy(a):
    if a == 51: return 2
    if a < 42: return pre[a]
    return gg[a%42]

n = II()
aa = LI()

aa.sort()
ss = []
pa = aa[0]
cnt = 1
x = 0
for a in aa[1:]:
    if a == pa+1:
        cnt += 1
    else:
        x ^= grundy(cnt)
        cnt = 1
    pa = a
x ^= grundy(cnt)

print("First" if x else "Second")
0