結果
| 問題 |
No.3090 NimNim
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2025-04-04 22:06:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 793 bytes |
| コンパイル時間 | 4,280 ms |
| コンパイル使用メモリ | 251,880 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-04-04 22:06:27 |
| 合計ジャッジ時間 | 6,629 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 17 WA * 8 |
ソースコード
#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001LL
bool win0(vector<long long> a){
long long x = 0;
rep(i,a.size()){
x ^= a[i];
}
return x != 0;
}
bool win1(vector<long long> a){
int c = 0;
rep(i,a.size()){
if(a[i]==1)c++;
}
return c%2==0;
}
int main() {
int n,m;
cin>>n>>m;
vector<long long> a(n),b(m);
rep(i,n)cin>>a[i];
rep(i,m)cin>>b[i];
bool f0 = win0(a),f1 = win1(a);
if(f0==f1){
if(f0)cout<<"First"<<endl;
else cout<<"Second"<<endl;
return 0;
}
if(f0){
if(win0(b))cout<<"First"<<endl;
else cout<<"Second"<<endl;
}
else{
cout<<"First"<<endl;
}
}
沙耶花