結果

問題 No.669 対決!!! 飲み比べ
ユーザー 👑 kmjpkmjp
提出日時 2018-03-26 23:03:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,079 ms / 2,000 ms
コード長 1,052 bytes
コンパイル時間 1,168 ms
コンパイル使用メモリ 151,564 KB
実行使用メモリ 7,524 KB
最終ジャッジ日時 2023-09-07 18:29:54
合計ジャッジ時間 10,494 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
7,488 KB
testcase_01 AC 5 ms
7,228 KB
testcase_02 AC 1,079 ms
7,344 KB
testcase_03 AC 33 ms
7,240 KB
testcase_04 AC 1,074 ms
7,280 KB
testcase_05 AC 940 ms
7,308 KB
testcase_06 AC 689 ms
7,268 KB
testcase_07 AC 8 ms
7,408 KB
testcase_08 AC 321 ms
7,304 KB
testcase_09 AC 5 ms
7,288 KB
testcase_10 AC 107 ms
7,248 KB
testcase_11 AC 506 ms
7,412 KB
testcase_12 AC 262 ms
7,252 KB
testcase_13 AC 25 ms
7,468 KB
testcase_14 AC 6 ms
7,296 KB
testcase_15 AC 1,024 ms
7,280 KB
testcase_16 AC 409 ms
7,312 KB
testcase_17 AC 214 ms
7,240 KB
testcase_18 AC 5 ms
7,292 KB
testcase_19 AC 813 ms
7,524 KB
testcase_20 AC 209 ms
7,224 KB
testcase_21 AC 106 ms
7,292 KB
testcase_22 AC 43 ms
7,268 KB
testcase_23 AC 262 ms
7,312 KB
testcase_24 AC 9 ms
7,240 KB
testcase_25 AC 9 ms
7,432 KB
testcase_26 AC 5 ms
7,212 KB
testcase_27 AC 6 ms
7,240 KB
testcase_28 AC 21 ms
7,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,K;
int A[1010];
int gr[1010100];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>K;
	for(i=1;i<=10000;i++) {
		set<int> S;
		for(j=1;j<=min(K,i);j++) S.insert(gr[i-j]);
		while(S.count(gr[i])) gr[i]++;
	}
	for(i=10001;i<=1000000;i++) gr[i]=gr[i-(K+1)];
	
	int nim=0;
	FOR(i,N) {
		cin>>x;
		nim^=gr[x];
	}
	if(nim==0) cout<<"NO"<<endl;
	else cout<<"YES"<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0