結果

問題 No.669 対決!!! 飲み比べ
ユーザー e6i24v_kyoproe6i24v_kyopro
提出日時 2021-05-06 00:49:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,048 ms / 2,000 ms
コード長 879 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 166,860 KB
実行使用メモリ 6,896 KB
最終ジャッジ日時 2023-10-11 18:25:11
合計ジャッジ時間 12,480 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
6,896 KB
testcase_01 AC 31 ms
6,676 KB
testcase_02 AC 1,048 ms
6,860 KB
testcase_03 AC 89 ms
6,788 KB
testcase_04 AC 1,048 ms
6,712 KB
testcase_05 AC 938 ms
6,788 KB
testcase_06 AC 727 ms
6,820 KB
testcase_07 AC 44 ms
6,816 KB
testcase_08 AC 406 ms
6,648 KB
testcase_09 AC 31 ms
6,716 KB
testcase_10 AC 181 ms
6,712 KB
testcase_11 AC 568 ms
6,760 KB
testcase_12 AC 356 ms
6,892 KB
testcase_13 AC 78 ms
6,648 KB
testcase_14 AC 37 ms
6,808 KB
testcase_15 AC 995 ms
6,708 KB
testcase_16 AC 483 ms
6,688 KB
testcase_17 AC 290 ms
6,764 KB
testcase_18 AC 31 ms
6,896 KB
testcase_19 AC 831 ms
6,788 KB
testcase_20 AC 288 ms
6,876 KB
testcase_21 AC 181 ms
6,680 KB
testcase_22 AC 97 ms
6,708 KB
testcase_23 AC 355 ms
6,744 KB
testcase_24 AC 46 ms
6,652 KB
testcase_25 AC 45 ms
6,644 KB
testcase_26 AC 31 ms
6,708 KB
testcase_27 AC 39 ms
6,860 KB
testcase_28 AC 67 ms
6,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

vector<int> sake(1000020);
int K;

void init(){
    for(int i=0;i<1000020;i++){
        vector<int> tmp(K+1);
        if(i<=K){
            sake[i]=i;
        }else{
            for(int k=1;k<=K;k++){
                tmp[sake[i-k]]=1;
            }
            for(int k=0;k<=K;k++){
                if(tmp[k]==0){
                    sake[i]=k;
                    break;
                }
            }
        }
        }
        
}


   
  

int main(){
    int N;
    cin>>N>>K;
    
    init();
    
    vector<int> A(N);
    
    int flag=0;
    
    for(int i=0;i<N;i++){
        cin>>A[i];
            flag^=sake[A[i]];
    
    }
    
    if(flag){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    /*
    for(int i=0;i<100;i++){
        cout<<sake[i]<<endl;
    }
    */
}
0