結果

問題 No.351 市松スライドパズル
ユーザー kurenai3110kurenai3110
提出日時 2016-05-25 14:35:57
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 701 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 65,068 KB
実行使用メモリ 526,244 KB
最終ジャッジ日時 2024-04-16 16:35:01
合計ジャッジ時間 6,276 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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