結果

問題 No.2044 Infinite Nim
ユーザー lloyzlloyz
提出日時 2022-08-19 23:06:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,652 KB
最終ジャッジ日時 2024-04-17 01:44:56
合計ジャッジ時間 3,512 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 30 ms
10,496 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 32 ms
10,496 KB
testcase_10 AC 31 ms
10,624 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 AC 31 ms
10,624 KB
testcase_13 AC 67 ms
15,552 KB
testcase_14 AC 50 ms
13,484 KB
testcase_15 AC 47 ms
12,872 KB
testcase_16 AC 50 ms
13,276 KB
testcase_17 AC 76 ms
17,140 KB
testcase_18 AC 47 ms
12,964 KB
testcase_19 AC 47 ms
12,928 KB
testcase_20 AC 66 ms
15,268 KB
testcase_21 AC 83 ms
18,324 KB
testcase_22 AC 66 ms
15,108 KB
testcase_23 AC 56 ms
13,696 KB
testcase_24 WA -
testcase_25 AC 57 ms
14,340 KB
testcase_26 WA -
testcase_27 AC 52 ms
13,184 KB
testcase_28 AC 91 ms
18,888 KB
testcase_29 WA -
testcase_30 AC 75 ms
16,480 KB
testcase_31 AC 100 ms
20,392 KB
testcase_32 AC 94 ms
20,512 KB
testcase_33 AC 98 ms
20,368 KB
testcase_34 WA -
testcase_35 AC 101 ms
21,652 KB
testcase_36 AC 31 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

res = 0
inf_n = 0
zero_n = 0
for i in range(n):
    if A[i] == -1:
        inf_n += 1
    elif A[i] == 0:
        zero_n += 1
    else:
        res ^= A[i] - 1

if zero_n + inf_n == n:
    print("First")
elif res != 0:
    print("First")
else:
    if inf_n % 2 == 0:
        print("Second")
    else:
        print("First")
0