結果
問題 |
No.3090 NimNim
|
ユーザー |
![]() |
提出日時 | 2025-04-04 22:03:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 794 bytes |
コンパイル時間 | 4,897 ms |
コンパイル使用メモリ | 250,448 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-04-04 22:04:08 |
合計ジャッジ時間 | 6,636 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 5 |
ソースコード
#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<<"Second"<<endl; } }