結果

問題 No.361 門松ゲーム2
ユーザー ttttan2ttttan2
提出日時 2019-06-03 22:36:47
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 1,150 bytes
コンパイル時間 2,303 ms
コンパイル使用メモリ 167,200 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 23:31:26
合計ジャッジ時間 3,104 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 61 ms
4,348 KB
testcase_15 AC 3 ms
4,348 KB
testcase_16 AC 39 ms
4,348 KB
testcase_17 AC 13 ms
4,348 KB
testcase_18 AC 8 ms
4,348 KB
testcase_19 AC 10 ms
4,348 KB
testcase_20 AC 3 ms
4,348 KB
testcase_21 AC 41 ms
4,348 KB
testcase_22 AC 116 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 3 ms
4,348 KB
testcase_25 AC 5 ms
4,348 KB
testcase_26 AC 15 ms
4,348 KB
testcase_27 AC 20 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
int main(){
    int g[1000];
    fill(g,g+1000,-1);
    rep(i,1,6)g[i]=0;
    int l,d;cin>>l>>d;
    if(d==1||l<=5){
        cout<<"matsu"<<endl;
        return 0;
    }
    rep(i,6,l+1){
        set<int> st;
        rep(j,1,ceil((double)i/3)){
            rep(k,j+2,j+d+1){
                if(j+j+1+k>i)break;
                if(i-j-k>=k||i-j-k<=j)continue;
                
                    st.insert(g[j]^g[k]^g[i-j-k]);
                
            }
        }
        int gg=0;
        while(st.count(gg)!=0)gg++;
        g[i]=gg;
    }
    if(g[l]==0)cout<<"matsu"<<endl;
    else cout<<"kado"<<endl;
    //rep(i,1,l+1)cout<<g[i]<<" ";
}
0