結果

問題 No.351 市松スライドパズル
コンテスト
ユーザー hanorver
提出日時 2016-03-11 23:29:04
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 628 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 345 ms
コンパイル使用メモリ 76,004 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-03 15:54:19
合計ジャッジ時間 5,258 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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