結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,048 KB
testcase_01 AC 18 ms
8,708 KB
testcase_02 AC 19 ms
9,060 KB
testcase_03 AC 20 ms
9,336 KB
testcase_04 AC 21 ms
9,580 KB
testcase_05 AC 23 ms
10,104 KB
testcase_06 AC 25 ms
10,196 KB
testcase_07 AC 27 ms
10,400 KB
testcase_08 WA -
testcase_09 AC 29 ms
11,140 KB
testcase_10 AC 30 ms
11,212 KB
testcase_11 AC 33 ms
11,800 KB
testcase_12 AC 34 ms
11,984 KB
testcase_13 AC 35 ms
12,484 KB
testcase_14 AC 39 ms
12,976 KB
testcase_15 AC 38 ms
12,856 KB
testcase_16 WA -
testcase_17 AC 39 ms
13,516 KB
testcase_18 AC 44 ms
14,064 KB
testcase_19 AC 43 ms
14,032 KB
testcase_20 AC 48 ms
14,800 KB
testcase_21 AC 49 ms
14,948 KB
testcase_22 AC 51 ms
15,544 KB
testcase_23 AC 48 ms
15,392 KB
testcase_24 AC 55 ms
16,240 KB
testcase_25 AC 54 ms
16,200 KB
testcase_26 AC 54 ms
16,192 KB
testcase_27 AC 60 ms
17,184 KB
testcase_28 AC 60 ms
17,332 KB
testcase_29 AC 60 ms
17,640 KB
testcase_30 AC 56 ms
16,308 KB
testcase_31 AC 52 ms
15,380 KB
testcase_32 AC 50 ms
14,728 KB
testcase_33 AC 55 ms
16,216 KB
testcase_34 AC 50 ms
14,836 KB
testcase_35 AC 16 ms
8,176 KB
testcase_36 AC 16 ms
8,128 KB
testcase_37 AC 16 ms
8,072 KB
testcase_38 AC 16 ms
8,248 KB
testcase_39 AC 16 ms
8,028 KB
testcase_40 AC 17 ms
8,072 KB
testcase_41 AC 16 ms
8,116 KB
testcase_42 AC 16 ms
8,076 KB
testcase_43 AC 16 ms
8,148 KB
testcase_44 AC 17 ms
8,136 KB
testcase_45 AC 17 ms
8,120 KB
testcase_46 AC 16 ms
8,136 KB
testcase_47 AC 16 ms
8,168 KB
testcase_48 AC 17 ms
8,112 KB
testcase_49 AC 17 ms
8,064 KB
testcase_50 AC 294 ms
66,664 KB
testcase_51 AC 282 ms
66,680 KB
testcase_52 AC 287 ms
66,620 KB
testcase_53 AC 287 ms
66,636 KB
testcase_54 AC 282 ms
66,680 KB
testcase_55 AC 288 ms
66,116 KB
testcase_56 AC 277 ms
63,476 KB
testcase_57 AC 258 ms
56,452 KB
testcase_58 WA -
testcase_59 AC 297 ms
66,672 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-42)%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