結果

問題 No.351 市松スライドパズル
ユーザー furafura
提出日時 2020-05-07 02:50:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 200,112 KB
実行使用メモリ 8,104 KB
最終ジャッジ日時 2023-09-16 07:41:16
合計ジャッジ時間 6,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
8,104 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 127 ms
7,808 KB
testcase_14 AC 126 ms
7,696 KB
testcase_15 AC 128 ms
7,996 KB
testcase_16 AC 128 ms
7,996 KB
testcase_17 AC 124 ms
7,948 KB
testcase_18 AC 124 ms
8,052 KB
testcase_19 AC 127 ms
7,984 KB
testcase_20 AC 128 ms
8,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int h,w,n; scanf("%d%d%d",&h,&w,&n);
	vector<char> type(n);
	vector<int> pos(n);
	rep(i,n) scanf(" %c%d",&type[i],&pos[i]);

	int x=0,y=0;
	for(int i=n-1;i>=0;i--){
		if(type[i]=='R'){
			if(pos[i]==y) x=(x+w-1)%w;
		}else{
			if(pos[i]==x) y=(y+h-1)%h;
		}
	}
	puts((x+y)%2==0?"white":"black");

	return 0;
}
0