結果
| 問題 |
No.669 対決!!! 飲み比べ
|
| ユーザー |
onoyik0515
|
| 提出日時 | 2018-07-28 16:27:24 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 382 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 22,656 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 20:34:19 |
| 合計ジャッジ時間 | 1,056 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 18 WA * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:11: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d%d",&N,&K);
| ~~~~~^~~~~~~~~~~~~~
main.cpp:10:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d",&A[i]);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
int i;
int N,K;
int result=0; //奇数:勝ち,偶数:負け
scanf("%d%d",&N,&K);
int A[1000];
for(i=0;i<N;i++){
scanf("%d",&A[i]);
if(A[i]%(K+1) != 0 ){
result =result+1;
}
}
if(result%2 ==1)
printf("YES\n");
else
printf("NO\n");
}
onoyik0515