結果

問題 No.669 対決!!! 飲み比べ
ユーザー e6i24v_kyoproe6i24v_kyopro
提出日時 2021-05-06 00:40:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 769 bytes
コンパイル時間 1,680 ms
コンパイル使用メモリ 166,072 KB
実行使用メモリ 7,008 KB
最終ジャッジ日時 2023-10-11 18:15:02
合計ジャッジ時間 14,052 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1,233 ms
6,808 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1,106 ms
6,772 KB
testcase_06 AC 855 ms
6,852 KB
testcase_07 AC 42 ms
6,984 KB
testcase_08 AC 471 ms
6,848 KB
testcase_09 WA -
testcase_10 AC 203 ms
6,776 KB
testcase_11 AC 662 ms
6,684 KB
testcase_12 WA -
testcase_13 AC 76 ms
6,812 KB
testcase_14 AC 35 ms
6,668 KB
testcase_15 AC 1,169 ms
6,936 KB
testcase_16 AC 562 ms
6,784 KB
testcase_17 WA -
testcase_18 AC 31 ms
6,724 KB
testcase_19 AC 976 ms
6,704 KB
testcase_20 AC 333 ms
6,840 KB
testcase_21 AC 203 ms
6,668 KB
testcase_22 AC 106 ms
6,708 KB
testcase_23 AC 408 ms
6,900 KB
testcase_24 AC 43 ms
7,000 KB
testcase_25 AC 42 ms
6,832 KB
testcase_26 AC 30 ms
6,896 KB
testcase_27 AC 37 ms
6,664 KB
testcase_28 AC 71 ms
6,780 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;
    }
    
}
0