結果
問題 |
No.2044 Infinite Nim
|
ユーザー |
|
提出日時 | 2022-09-28 16:54:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 1,961 ms |
コンパイル使用メモリ | 191,764 KB |
最終ジャッジ日時 | 2025-02-07 17:56:22 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; int x=0,cntI=0; for(int i=0;i<N;i++){ int a; cin>>a; if(a==-1){ ++cntI; }else{ x^=a; } } if(cntI%2||cntI%2==0&&x!=0)cout<<"First\n"; else cout<<"Second\n"; }