結果

問題 No.715 集合と二人ゲーム
ユーザー makichan
提出日時 2025-02-10 22:08:28
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,096 bytes
コンパイル時間 3,643 ms
コンパイル使用メモリ 281,576 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-10 22:08:38
合計ジャッジ時間 9,205 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 43 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
// #include <atcoder/all>
// using mint = atcoder::static_modint<998244353>;
// using mint = atcoder::static_modint<1000000007>;
using namespace std;
// using namespace atcoder;
using ld = long double;
using ll = long long;
#define mp(a,b) make_pair(a,b)
#define rep(i,s,n) for(int i=s; i<(int)n; i++)
const vector<int> dx{1,0,-1,0},dy{0,1,0,-1};

vector<int> experiment(){
    vector<int> G(34);
    G[1]=true;
    rep(i,2,34){
        vector<bool> b(16);
        b[G[i-2]]=true;
        rep(j,2,i){
            b[G[j-2]^G[i-(j+1)]]=true;
        }
        while(b[G[i]])G[i]++;
    }

    // rep(i,0,60)cout << i << " " << G[i] << "\n";
    // cout << clock() << "\n";
    // cout << *max_element(G.begin(),G.end());
    return G;
}

int main(){
    auto v=experiment();
    int n;cin >> n;
    int a[n+1];rep(i,0,n)cin >> a[i];
    a[n]=2e9;
    sort(a,a+n+1);
    int cnt=1;
    int g=0;
    rep(i,1,n+1){
        if(a[i-1]+1==a[i])cnt++;
        else{
            g^=v[cnt%34];
            cnt=1;
        }
    }
    if(g)cout <<"First";
    else cout << "Second";
}
0