結果

問題 No.2044 Infinite Nim
ユーザー satama6satama6
提出日時 2022-10-18 23:05:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 18,996 KB
最終ジャッジ日時 2023-09-11 14:59:58
合計ジャッジ時間 3,118 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,872 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 16 ms
7,780 KB
testcase_03 AC 15 ms
7,828 KB
testcase_04 AC 15 ms
7,924 KB
testcase_05 AC 15 ms
7,788 KB
testcase_06 AC 14 ms
7,788 KB
testcase_07 AC 14 ms
7,992 KB
testcase_08 AC 15 ms
7,972 KB
testcase_09 AC 15 ms
7,872 KB
testcase_10 AC 15 ms
7,788 KB
testcase_11 AC 14 ms
7,784 KB
testcase_12 AC 15 ms
7,788 KB
testcase_13 AC 40 ms
13,384 KB
testcase_14 AC 29 ms
11,136 KB
testcase_15 AC 28 ms
10,692 KB
testcase_16 AC 27 ms
11,152 KB
testcase_17 AC 43 ms
14,856 KB
testcase_18 AC 27 ms
10,532 KB
testcase_19 AC 27 ms
10,736 KB
testcase_20 AC 37 ms
13,184 KB
testcase_21 AC 51 ms
16,168 KB
testcase_22 AC 38 ms
13,536 KB
testcase_23 AC 31 ms
11,832 KB
testcase_24 AC 43 ms
14,628 KB
testcase_25 AC 30 ms
11,916 KB
testcase_26 AC 42 ms
14,224 KB
testcase_27 AC 29 ms
11,404 KB
testcase_28 AC 54 ms
18,048 KB
testcase_29 AC 32 ms
12,788 KB
testcase_30 AC 45 ms
14,940 KB
testcase_31 AC 60 ms
18,112 KB
testcase_32 AC 59 ms
18,092 KB
testcase_33 AC 59 ms
18,004 KB
testcase_34 AC 51 ms
16,080 KB
testcase_35 AC 60 ms
18,996 KB
testcase_36 AC 14 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

grundy = 0
cnt = 0

for a in A:
    if a == -1:
        cnt += 1
    else:
        grundy ^= a

if cnt & 1:
    print('First')
elif grundy > 0:
    print('First')
else:
    print('Second')
    
0