結果
問題 | No.669 対決!!! 飲み比べ |
ユーザー |
|
提出日時 | 2018-03-23 22:32:11 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 1,389 ms |
コンパイル使用メモリ | 157,680 KB |
実行使用メモリ | 9,164 KB |
最終ジャッジ日時 | 2024-06-25 02:02:09 |
合計ジャッジ時間 | 2,788 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d%d",&n,&k); | ~~~~~^~~~~~~~~~~~~~ main.cpp:15:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d",&a[i]); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>#define MOD 1000000007LLusing namespace std;typedef long long ll;typedef pair<int,int> P;int n,k;int a[1000001];int dp[1000001];int cnt[1001];int main(void){scanf("%d%d",&n,&k);for(int i=0;i<n;i++){scanf("%d",&a[i]);}for(int i=1;i<=1000000;i++){dp[i]=i%(k+1);}int bi=0;for(int i=0;i<n;i++){bi^=dp[a[i]];}printf("%s\n",bi!=0?"YES":"NO");return 0;}