結果

問題 No.351 市松スライドパズル
ユーザー hanorverhanorver
提出日時 2016-03-11 23:29:04
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 60,116 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 05:59:47
合計ジャッジ時間 4,947 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 215 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
4,348 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 317 ms
4,348 KB
testcase_16 AC 318 ms
4,348 KB
testcase_17 AC 312 ms
4,348 KB
testcase_18 AC 310 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 315 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>

int main() {
	int h, w, n;
	std::cin >> h >> w >> n;
	
	std::vector<int> hori(h), v(w);
	for (int i = 0; i < n; i++) {
		char c;
		int k;
		std::cin >> c >> k;
		if (c == 'R') {
			hori[k]--;
			if (hori[k] < 0) hori[k] = w - 1;
		} else {
			v[k]--;
			if (v[k] < 0) v[k] = h - 1;
		}
	}

	if (hori[0] % 2 == 0) {
		// 白
		if (v[hori[0]] % 2 == 0) {
			std::cout << "white" << std::endl;
		} else {
			std::cout << "black" << std::endl;
		}
	} else {
		if (v[hori[0]] % 2 == 0) {
			std::cout << "black" << std::endl;
		} else {
			std::cout << "white" << std::endl;
		}
	}
	return 0;
}
0