結果

問題 No.669 対決!!! 飲み比べ
ユーザー wpqyvbfgwpqyvbfg
提出日時 2018-07-14 17:01:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 22,656 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 03:01:26
合計ジャッジ時間 1,149 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 AC 0 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 0 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 1 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 0 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 1 ms
5,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 0 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: 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:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                 scanf("%d", &A[i]);
      |                 ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	int i;
	int N, K;
	scanf("%d%d", &N, &K);
	bool result;
	int A[1000];

	for (i = 0; i < N; i++) {
		scanf("%d", &A[i]);
	}
	
	result = (A[0] % (K + 1) != 0);
	for (i = 1; i < N; i++) {
		result = result ^ ((A[i] - 1) % (K + 1));
	}

	if (result)
		printf("YES\n");
	else
		printf("NO\n");
}
0