結果

問題 No.715 集合と二人ゲーム
ユーザー tonyu0tonyu0
提出日時 2021-02-02 15:16:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 689 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 87,356 KB
実行使用メモリ 214,184 KB
最終ジャッジ日時 2023-09-12 11:06:12
合計ジャッジ時間 9,514 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
76,236 KB
testcase_01 AC 80 ms
76,584 KB
testcase_02 AC 82 ms
76,572 KB
testcase_03 AC 85 ms
76,884 KB
testcase_04 AC 83 ms
77,164 KB
testcase_05 AC 85 ms
77,560 KB
testcase_06 AC 88 ms
79,096 KB
testcase_07 AC 89 ms
79,844 KB
testcase_08 AC 87 ms
80,656 KB
testcase_09 AC 89 ms
81,300 KB
testcase_10 AC 90 ms
82,244 KB
testcase_11 AC 91 ms
83,188 KB
testcase_12 AC 90 ms
83,272 KB
testcase_13 AC 94 ms
84,200 KB
testcase_14 AC 95 ms
85,512 KB
testcase_15 AC 93 ms
85,316 KB
testcase_16 AC 96 ms
88,004 KB
testcase_17 AC 95 ms
88,028 KB
testcase_18 AC 98 ms
89,684 KB
testcase_19 AC 99 ms
89,556 KB
testcase_20 AC 100 ms
91,596 KB
testcase_21 AC 103 ms
91,712 KB
testcase_22 AC 102 ms
93,332 KB
testcase_23 AC 102 ms
93,284 KB
testcase_24 AC 102 ms
93,656 KB
testcase_25 AC 102 ms
93,764 KB
testcase_26 AC 107 ms
93,700 KB
testcase_27 AC 103 ms
96,256 KB
testcase_28 AC 109 ms
98,180 KB
testcase_29 AC 108 ms
98,248 KB
testcase_30 AC 105 ms
96,244 KB
testcase_31 AC 102 ms
93,708 KB
testcase_32 AC 99 ms
91,412 KB
testcase_33 AC 106 ms
95,908 KB
testcase_34 AC 102 ms
91,444 KB
testcase_35 AC 79 ms
76,184 KB
testcase_36 AC 79 ms
76,108 KB
testcase_37 AC 80 ms
75,928 KB
testcase_38 AC 80 ms
76,028 KB
testcase_39 AC 81 ms
76,164 KB
testcase_40 AC 81 ms
76,060 KB
testcase_41 AC 80 ms
75,932 KB
testcase_42 AC 81 ms
75,980 KB
testcase_43 AC 81 ms
76,040 KB
testcase_44 AC 84 ms
76,160 KB
testcase_45 AC 79 ms
76,188 KB
testcase_46 AC 82 ms
76,188 KB
testcase_47 AC 78 ms
75,920 KB
testcase_48 AC 81 ms
76,024 KB
testcase_49 AC 80 ms
75,928 KB
testcase_50 AC 224 ms
214,184 KB
testcase_51 AC 221 ms
214,028 KB
testcase_52 AC 217 ms
213,824 KB
testcase_53 AC 220 ms
212,208 KB
testcase_54 AC 220 ms
213,060 KB
testcase_55 AC 215 ms
214,116 KB
testcase_56 AC 207 ms
199,420 KB
testcase_57 AC 204 ms
196,888 KB
testcase_58 AC 216 ms
213,140 KB
testcase_59 AC 218 ms
214,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(sorted(set(map(int, input().split()))))

gr=[-1]*99
gr[0]=0
def grundy(x):
    if x<=0:
        return 0
    if gr[x]>=0:
        return gr[x]
    g=set()
    for i in range(1,x+1):
        # iを取ったとき
        # o o x i x o o o
        l=i-2
        r=x-(i+1)
        g.add(grundy(l)^grundy(r))
    res=0
    while res in g:
        res+=1
    gr[x]=res
    return res

g=[grundy(i) for i in range(90)]
#g[54]=0;g[88]=0
all=0
l=a[0]
r=a[0]
for e in a:
    if e>r+1:
        num=r-l+1
        if num>54:num=54+(num-54)%34
        all^=g[num]
        l=e
    r=e

num=r-l+1
if num>54:num=54+(num-54)%34
all^=g[num]

if all:print('First')
else:print('Second')
0