結果
| 問題 | No.3090 NimNim | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-04-04 23:06:05 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 73 ms / 2,000 ms | 
| コード長 | 762 bytes | 
| コンパイル時間 | 5,469 ms | 
| コンパイル使用メモリ | 332,312 KB | 
| 実行使用メモリ | 6,272 KB | 
| 最終ジャッジ日時 | 2025-04-04 23:06:18 | 
| 合計ジャッジ時間 | 7,839 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 | 
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
int main()
{
    int n,m;
    cin>>n>>m;
    vector<int> a(n),b(m);
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<m;i++)cin>>b[i];
    bool f=false;
    for(int i=0;i<n;i++)if(a[i]>1)f=true;
    if(f){
        int x=0;
        for(int i=0;i<n;i++)x=(x^a[i]);
        if(x){
            cout<<"First"<<endl;
        }else{
            cout<<"Second"<<endl;
        }
    }else{
        if(n%2==0){
            cout<<"First"<<endl;
            return 0;
        }else{
            int x=0;
            for(int i=0;i<m;i++)x=(x^b[i]);
            if(x)cout<<"First"<<endl;
            else cout<<"Second"<<endl;
        }
    }
    return 0;
}
            
            
            
        