結果

問題 No.715 集合と二人ゲーム
ユーザー tonyu0tonyu0
提出日時 2021-02-02 11:32:38
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 564 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 222,580 KB
最終ジャッジ日時 2023-09-12 11:02:52
合計ジャッジ時間 14,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,424 KB
testcase_01 AC 87 ms
76,660 KB
testcase_02 AC 93 ms
77,108 KB
testcase_03 AC 100 ms
78,052 KB
testcase_04 AC 112 ms
79,196 KB
testcase_05 AC 123 ms
79,428 KB
testcase_06 AC 114 ms
80,504 KB
testcase_07 AC 113 ms
81,240 KB
testcase_08 AC 122 ms
81,660 KB
testcase_09 AC 195 ms
83,904 KB
testcase_10 AC 214 ms
84,380 KB
testcase_11 AC 202 ms
85,328 KB
testcase_12 AC 297 ms
84,028 KB
testcase_13 AC 200 ms
86,580 KB
testcase_14 RE -
testcase_15 AC 216 ms
87,884 KB
testcase_16 AC 271 ms
90,408 KB
testcase_17 RE -
testcase_18 AC 278 ms
92,412 KB
testcase_19 AC 344 ms
91,912 KB
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 AC 103 ms
93,456 KB
testcase_32 WA -
testcase_33 AC 105 ms
95,592 KB
testcase_34 WA -
testcase_35 AC 73 ms
71,312 KB
testcase_36 AC 73 ms
71,096 KB
testcase_37 AC 74 ms
71,300 KB
testcase_38 AC 73 ms
71,248 KB
testcase_39 AC 73 ms
71,360 KB
testcase_40 AC 74 ms
71,360 KB
testcase_41 AC 74 ms
71,360 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 74 ms
71,156 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 77 ms
71,312 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 306 ms
222,516 KB
testcase_52 WA -
testcase_53 AC 284 ms
219,728 KB
testcase_54 WA -
testcase_55 AC 267 ms
222,148 KB
testcase_56 WA -
testcase_57 AC 240 ms
202,832 KB
testcase_58 AC 261 ms
221,560 KB
testcase_59 AC 253 ms
222,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

gr=[-1]*(n+1)
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,min(99,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
    
all=0
l=a[0]
r=a[0]
for e in a:
    if e>r+1:
        all^=grundy(r-l+1)
        l=e
    r=e
all^=grundy(r-l+1)
if all:print('First')
else:print('Second')
0