結果

問題 No.669 対決!!! 飲み比べ
ユーザー SugarDragon5SugarDragon5
提出日時 2018-03-23 22:52:24
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 922 bytes
コンパイル時間 1,582 ms
コンパイル使用メモリ 167,084 KB
実行使用メモリ 17,660 KB
最終ジャッジ日時 2023-09-07 07:43:24
合計ジャッジ時間 3,024 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,240 KB
testcase_01 AC 5 ms
7,488 KB
testcase_02 AC 6 ms
8,388 KB
testcase_03 AC 5 ms
7,276 KB
testcase_04 AC 4 ms
7,308 KB
testcase_05 AC 5 ms
7,248 KB
testcase_06 AC 10 ms
10,340 KB
testcase_07 AC 5 ms
7,284 KB
testcase_08 AC 5 ms
7,268 KB
testcase_09 AC 5 ms
7,300 KB
testcase_10 AC 12 ms
11,608 KB
testcase_11 AC 24 ms
17,452 KB
testcase_12 AC 5 ms
7,392 KB
testcase_13 AC 6 ms
8,316 KB
testcase_14 AC 5 ms
7,424 KB
testcase_15 AC 5 ms
7,608 KB
testcase_16 AC 4 ms
7,304 KB
testcase_17 AC 4 ms
7,212 KB
testcase_18 AC 5 ms
7,292 KB
testcase_19 AC 5 ms
7,328 KB
testcase_20 AC 5 ms
7,428 KB
testcase_21 AC 5 ms
7,252 KB
testcase_22 AC 4 ms
7,368 KB
testcase_23 AC 24 ms
17,660 KB
testcase_24 AC 4 ms
7,344 KB
testcase_25 AC 4 ms
7,248 KB
testcase_26 AC 5 ms
7,236 KB
testcase_27 AC 5 ms
7,236 KB
testcase_28 AC 5 ms
7,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<int,P>
#define vpp vector<PP>
#define fi first
#define se second
#define INF 1e9
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int k;
int dp[1000001];
int grundy(int x){
    if(x==0){
        return dp[0]=0;
    }
    return dp[x]=(grundy(x-1)+1)%(k+1);
}
int main(){
    int n;
    cin>>n>>k;
    vi vec(n);
    REP(i,n){
        cin>>vec[i];
    }
    REP(i,1000001){
        dp[i]=-1;
    }
    grundy(*max_element(all(vec)));
    int ans=0;
    REP(i,n){
        ans^=dp[vec[i]];
    }
    if(ans!=0){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    return 0;
}
0