結果
問題 | No.2044 Infinite Nim |
ユーザー |
![]() |
提出日時 | 2022-05-05 22:20:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 463 bytes |
コンパイル時間 | 2,009 ms |
コンパイル使用メモリ | 194,536 KB |
最終ジャッジ日時 | 2025-01-29 02:31:03 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i = 0; i < (int)(n); i++)using namespace std;using LL = long long;const int Max_N = (int)1e5;const int Max_A = (int)1e9;const LL LINF = (int)1e18;int main(){int N;cin >> N;vector<LL> A(N);rep(i,N) cin >> A[i];rep(i,N) if(A[i] == -1) A[i] = LINF;LL g = 0;rep(i,N) g ^= A[i];if(g != 0) cout << "First" << endl;else cout << "Second" << endl;return 0;}