結果
問題 | No.2044 Infinite Nim |
ユーザー |
![]() |
提出日時 | 2022-08-19 22:01:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 83 ms / 2,000 ms |
コード長 | 369 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 21,656 KB |
最終ジャッジ日時 | 2024-10-09 06:05:57 |
合計ジャッジ時間 | 3,184 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
N = int(input())A = list(map(int, input().split()))nim = 0inf = 0for a in A:if a == -1:inf += 1else:nim ^= aif inf == 0:if nim:print("First")else:print("Second")else:if inf % 2 == 1:print("First")else:if nim:print("First")else:print("Second")