結果

問題 No.351 市松スライドパズル
ユーザー mizuyoukannKBmizuyoukannKB
提出日時 2016-04-03 18:43:20
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 56,096 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 10:48:52
合計ジャッジ時間 2,974 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 AC 2 ms
6,948 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 WA -
testcase_14 AC 98 ms
6,940 KB
testcase_15 WA -
testcase_16 AC 100 ms
6,940 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 101 ms
6,940 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <string>
#include <iostream>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	int h, w;						//不要なワーク
	int input;						//入力
	bool rBit = true, cBit = true;	//Rbit, Cbit
	string str1, str2;				//文字列

	cin >> h >> w;
	cin >> input;

	while(input)
	{
		cin >> str1 >> str2;

		str1 += str2;

		if(str1 == "R0")
		{
			if(!(w & 1))
			{
				rBit = !rBit;
				++w;
			}

			rBit = !rBit;
		}

		if(str1 == "C0")
		{
			if(!(h & 1))
			{
				cBit = !cBit;
				++h;
			}

			cBit = !cBit;
		}

		--input;
	}

	cout << ((rBit ^ cBit) ? ("black") : ("white")) << endl;

	return 0;
}
0