結果

問題 No.2285 Make A Unit Square
ユーザー fumofumofunifumofumofuni
提出日時 2023-04-29 11:19:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,820 bytes
コンパイル時間 2,085 ms
コンパイル使用メモリ 207,052 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-29 07:41:00
合計ジャッジ時間 2,608 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")

#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=(n)-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,1,0,-1,1,-1,1,-1,0};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main(){
    ll n=1000;//cin >> n;
    vl dp(n);dp[2]=0;dp[3]=0;
    for(ll i=4;i<n;i++){
        set<ll> st;
        for(ll j=2;j<i-1;j++){
            st.insert(dp[j]^dp[i-j]);
        }
        rep(j,10000){
            if(st.count(j))continue;
            dp[i]=j;break;
        }
    }
    //rep(i,30)cout << dp[i*34+3] << endl;
    return 0;
    ll t;cin >> t;
    while(t--){
        ll a,b;cin >> a >> b;
        ll f=0;
        if(a<1000)f=dp[a];
        else {
            a%=34;a+=680;f=dp[a];
        }
        ll g=0;
        if(b<1000)g=dp[b];
        else {
            b%=34;b+=680;g=dp[b];
        }
        cout << ((f^g)? "First":"Second") << endl;

    }
    //rep(i,n)cout << dp[i] <<" ";cout << endl;
}


0