結果

問題 No.351 市松スライドパズル
ユーザー treeonetreeone
提出日時 2016-03-11 23:00:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 372 ms / 2,000 ms
コード長 943 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 77,844 KB
実行使用メモリ 38,220 KB
最終ジャッジ日時 2023-10-25 07:12:17
合計ジャッジ時間 5,696 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
38,220 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 357 ms
37,496 KB
testcase_14 AC 356 ms
37,692 KB
testcase_15 AC 372 ms
38,220 KB
testcase_16 AC 371 ms
38,220 KB
testcase_17 AC 365 ms
38,220 KB
testcase_18 AC 368 ms
38,220 KB
testcase_19 AC 365 ms
38,220 KB
testcase_20 AC 371 ms
38,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <stack>
#include <queue>
#include <utility>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define rrep(i,n,l) for(int i=n-1;i>=l;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a);
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int h,w,n;
	cin>>h>>w>>n;
	vector<string> s(n);
	vector<int> k(n);
	rep(i,0,n){
		cin>>s[i]>>k[i];
	}
	int y=0,x=0;
	rrep(i,n,0){
		if(s[i]=="R" && y==k[i]){
			x--;
			if(x==-1) x=w-1;
		}
		if(s[i]=="C" && x==k[i]){
			y--;
			if(y==-1) y=h-1;
		}
	}
	if((int)(x+y)%2) o("black");
	else o("white");
}
0