結果

問題 No.715 集合と二人ゲーム
ユーザー nebukuro09nebukuro09
提出日時 2018-07-13 23:38:33
言語 Python2
(2.7.18)
結果
AC  
実行時間 763 ms / 2,000 ms
コード長 749 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 50,092 KB
最終ジャッジ日時 2024-04-17 11:39:49
合計ジャッジ時間 31,634 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 401 ms
6,528 KB
testcase_01 AC 405 ms
6,784 KB
testcase_02 AC 404 ms
6,912 KB
testcase_03 AC 409 ms
7,168 KB
testcase_04 AC 411 ms
7,424 KB
testcase_05 AC 418 ms
7,680 KB
testcase_06 AC 414 ms
7,936 KB
testcase_07 AC 417 ms
8,064 KB
testcase_08 AC 417 ms
8,320 KB
testcase_09 AC 421 ms
8,704 KB
testcase_10 AC 422 ms
8,800 KB
testcase_11 AC 424 ms
9,188 KB
testcase_12 AC 427 ms
9,328 KB
testcase_13 AC 429 ms
9,696 KB
testcase_14 AC 432 ms
9,880 KB
testcase_15 AC 430 ms
10,104 KB
testcase_16 AC 434 ms
10,364 KB
testcase_17 AC 435 ms
10,432 KB
testcase_18 AC 440 ms
10,956 KB
testcase_19 AC 447 ms
10,964 KB
testcase_20 AC 440 ms
11,456 KB
testcase_21 AC 444 ms
11,860 KB
testcase_22 AC 446 ms
12,132 KB
testcase_23 AC 442 ms
11,952 KB
testcase_24 AC 452 ms
12,604 KB
testcase_25 AC 450 ms
12,604 KB
testcase_26 AC 450 ms
12,624 KB
testcase_27 AC 458 ms
13,388 KB
testcase_28 AC 463 ms
13,668 KB
testcase_29 AC 460 ms
13,884 KB
testcase_30 AC 454 ms
12,848 KB
testcase_31 AC 447 ms
11,952 KB
testcase_32 AC 446 ms
11,476 KB
testcase_33 AC 454 ms
12,700 KB
testcase_34 AC 447 ms
11,596 KB
testcase_35 AC 403 ms
6,528 KB
testcase_36 AC 400 ms
6,400 KB
testcase_37 AC 403 ms
6,400 KB
testcase_38 AC 402 ms
6,272 KB
testcase_39 AC 403 ms
6,272 KB
testcase_40 AC 402 ms
6,528 KB
testcase_41 AC 403 ms
6,656 KB
testcase_42 AC 401 ms
6,656 KB
testcase_43 AC 400 ms
6,528 KB
testcase_44 AC 407 ms
6,656 KB
testcase_45 AC 402 ms
6,400 KB
testcase_46 AC 403 ms
6,528 KB
testcase_47 AC 404 ms
6,528 KB
testcase_48 AC 401 ms
6,656 KB
testcase_49 AC 400 ms
6,528 KB
testcase_50 AC 757 ms
50,092 KB
testcase_51 AC 754 ms
49,992 KB
testcase_52 AC 758 ms
49,872 KB
testcase_53 AC 752 ms
49,812 KB
testcase_54 AC 760 ms
49,908 KB
testcase_55 AC 751 ms
49,528 KB
testcase_56 AC 736 ms
47,328 KB
testcase_57 AC 717 ms
44,768 KB
testcase_58 AC 763 ms
49,972 KB
testcase_59 AC 757 ms
49,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = 2000
F = [0 for _ in xrange(N)]
F[1] = 1
F[2] = 1
for i in xrange(3, N):
    H = set([F[i-2], F[i-3]])
    j = 1
    while i - 3 - j >= j:
        k = i - 3 - j
        H.add(F[j]^F[k])
        j += 1
    H = sorted(list(H))
    for j in xrange(len(H)+1):
        if j >= len(H) or H[j] != j:
            F[i] = j
            break

n = input()
A = sorted(map(int, raw_input().split()))
B = []

last = -1
cnt = 0
for a in A:
    if last == -1:
        last = a
        cnt = 1
    elif a - last == 1:
        last = a
        cnt += 1
    else:
        B.append(cnt)
        last = a
        cnt = 1
B.append(cnt)

ans = 0
for b in B:
    if b >= N:
        ans ^= F[34*10+b%34]
    else:
        ans ^= F[b]

print "First" if ans else "Second"
0