結果
| 問題 | No.2044 Infinite Nim |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-09-17 02:42:58 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 6 ms / 2,000 ms |
| + 372µs | |
| コード長 | 667 bytes |
| 記録 | |
| コンパイル時間 | 2,924 ms |
| コンパイル使用メモリ | 352,568 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-17 02:43:04 |
| 合計ジャッジ時間 | 5,657 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll=long long;
using ld=long double;
const ll MOD=1e9+7;
const ll INF=1e18+7;
#define pb push_back
#define fi first
#define se second
void solve(){
int n;
cin>>n;
int cnt=0;
ll xsum=0;
for(int i=0;i<n;++i){
ll a;
cin>>a;
if(a==-1){
++cnt;
}
else{
xsum^=a;
}
}
if(cnt%2!=0||xsum!=0){
cout<<"First";
}
else{
cout<<"Second";
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t=1;
// cin>>t;
for(int tc=1;tc<=t;++tc){
solve();
cout<<"\n";
}
return 0;
}
vjudge1