結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,212 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 21 ms
9,428 KB
testcase_04 WA -
testcase_05 AC 24 ms
9,920 KB
testcase_06 WA -
testcase_07 AC 27 ms
10,476 KB
testcase_08 WA -
testcase_09 AC 31 ms
11,080 KB
testcase_10 WA -
testcase_11 AC 32 ms
11,760 KB
testcase_12 WA -
testcase_13 AC 36 ms
12,524 KB
testcase_14 WA -
testcase_15 AC 39 ms
12,876 KB
testcase_16 WA -
testcase_17 AC 40 ms
13,544 KB
testcase_18 WA -
testcase_19 AC 44 ms
14,168 KB
testcase_20 WA -
testcase_21 AC 48 ms
14,920 KB
testcase_22 WA -
testcase_23 AC 50 ms
15,336 KB
testcase_24 WA -
testcase_25 AC 54 ms
16,100 KB
testcase_26 WA -
testcase_27 AC 58 ms
16,944 KB
testcase_28 WA -
testcase_29 AC 62 ms
17,728 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 57 ms
16,264 KB
testcase_34 WA -
testcase_35 AC 16 ms
8,160 KB
testcase_36 AC 16 ms
8,064 KB
testcase_37 AC 16 ms
8,116 KB
testcase_38 AC 16 ms
8,000 KB
testcase_39 AC 16 ms
8,124 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 17 ms
8,044 KB
testcase_44 WA -
testcase_45 AC 17 ms
8,116 KB
testcase_46 WA -
testcase_47 AC 17 ms
8,104 KB
testcase_48 WA -
testcase_49 AC 17 ms
8,084 KB
testcase_50 WA -
testcase_51 AC 281 ms
66,612 KB
testcase_52 WA -
testcase_53 AC 287 ms
66,424 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 AC 250 ms
56,316 KB
testcase_58 WA -
testcase_59 AC 287 ms
66,644 KB
権限があれば一括ダウンロードができます

ソースコード

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%34]

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