結果
| 問題 |
No.3090 NimNim
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-04 21:49:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 580 bytes |
| コンパイル時間 | 468 ms |
| コンパイル使用メモリ | 60,832 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-04-04 21:49:37 |
| 合計ジャッジ時間 | 2,141 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int N,M;
int A[1<<17],B[1<<17];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>N>>M;
for(int i=0;i<N;i++)cin>>A[i];
for(int i=0;i<M;i++)cin>>B[i];
{//A=1
bool one=true;
for(int i=0;i<N;i++)if(A[i]>1)one=false;
if(one)
{
if(N%2==0)
{//always second
cout<<"First"<<endl;
}
else
{//alter
int X=0;
for(int i=0;i<M;i++)X^=B[i];
cout<<(X?"First":"Second")<<endl;
}
return 0;
}
}
int X=0;
for(int i=0;i<N;i++)X^=A[i];
cout<<(X?"First":"Second")<<endl;
}