結果

問題 No.351 市松スライドパズル
コンテスト
ユーザー sugim48
提出日時 2016-03-11 22:31:03
言語 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  
実行時間 -
コード長 733 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 530 ms
コンパイル使用メモリ 103,796 KB
実行使用メモリ 38,656 KB
最終ジャッジ日時 2026-09-03 15:35:06
合計ジャッジ時間 6,741 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
using namespace std;

typedef long long ll;

int MOD = 1000000007;

int main() {
	int H, W; cin >> H >> W;
	int N; cin >> N;
	vector<string> s(N);
	vector<int> a(N);
	for (int i = 0; i < N; i++)
		cin >> s[i] >> a[i];
	int y = 0, x = 0;
	for (int i = N - 1; i >= 0; i--) {
		if (s[i] == "R" && a[i] == y) x = (x - 1) % W;
		if (s[i] == "C" && a[i] == x) y = (y - 1) % H;
	}
	cout << ((y + x) % 2 == 0 ? "white" : "black") << endl;
}
0