結果

問題 No.3090 NimNim
ユーザー pockyny
提出日時 2025-07-09 03:13:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 68,356 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-09 03:13:46
合計ジャッジ時間 4,608 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int a[100010],b[100010];
int main(){
    int i,n,m; cin >> n >> m;
    for(i=0;i<n;i++) cin >> a[i];
    for(i=0;i<m;i++) cin >> b[i];
    int mx = 0;
    for(i=0;i<n;i++) mx = max(mx,a[i]);
    if(mx==1){
        int x = 0;
        for(i=0;i<m;i++) x ^= b[i];
        if(n&1){
            if(x==0) cout << "Second\n";
            else cout << "First\n";
        }else{
            if(x==0) cout << "First\n";
            else cout << "Second\n";
        }
    }else{
        int x = 0;
        for(i=0;i<n;i++) x ^= a[i];
        if(x>0){
            cout << "First\n";
        }else{
            cout << "Second\n";
        }
    }
}
0