結果

問題 No.669 対決!!! 飲み比べ
ユーザー wpqyvbfgwpqyvbfg
提出日時 2018-07-14 16:59:21
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 22,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 02:55:39
合計ジャッジ時間 1,314 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 0 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 0 ms
5,376 KB
testcase_06 AC 0 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 0 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
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 AC 0 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 AC 0 ms
5,376 KB
testcase_28 AC 0 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