結果

問題 No.351 市松スライドパズル
コンテスト
ユーザー kurenai3110
提出日時 2016-05-25 14:35:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 701 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 64,764 KB
実行使用メモリ 543,264 KB
最終ジャッジ日時 2024-10-07 14:05:53
合計ジャッジ時間 6,636 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 9 MLE * 1 -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {
	int h,w,n;
	char c;
	int k;
	
	cin >> h >> w >> n;
	
	vector< vector<int> > masu;
	masu.resize(h);
	for(int j=0;j<h;j++){
		masu[j].resize(w);
		for(int l=0;l<w;l++){
			if(l%2&&!(j%2) || !(l%2)&&j%2) masu[j][l] = 1;		//黒
			else	masu[j][l] = 0;		//白
		}
	}
	
	for(int i=0;i<n;i++){
		cin >> c >> k;
		if(c == 'R'){
			masu[k].insert(masu[k].begin(),masu[k].back());
			masu[k].pop_back();
		}else if(c == 'C'){
			int last = masu[h-1][k];
			for(int m=h-1;m>0;m--){
				masu[m][k] = masu[m-1][k];
			}
			masu[0][k] = last;
		}
	}
	
	if(masu[0][0])	cout << "black" << endl;
	else 			cout << "white" << endl;
	
	return 0;
}
0