結果
| 問題 | No.2044 Infinite Nim |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-09-17 11:30:40 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 6 ms / 2,000 ms |
| + 717µs | |
| コード長 | 823 bytes |
| 記録 | |
| コンパイル時間 | 2,065 ms |
| コンパイル使用メモリ | 330,460 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-17 11:30:48 |
| 合計ジャッジ時間 | 4,610 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define ull unsigned long long
#define pb push_back
#define pr_queue priority_queue
#define ld long double
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const int maxn = 5e5 + 5;
//const ld INF = 1/.0;
//miyabi my beloved
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
// cin>>t;
while(t--){
int n;
cin>>n;
ll a[n + 1];
int k = 0;
ll sum = 0;
for(int i = 1; i <= n; i++){
cin>>a[i];
if(a[i] == -1) k++;
else sum ^= a[i];
}
if(k == 0){
if(sum == 0) cout<<"Second\n";
else cout<<"First\n";
}
else{
if(k % 2) cout<<"First\n";
else{
if(sum == 0) cout << "Second\n";
else cout<<"First\n";
}
}
}
}
vjudge1