結果

問題 No.351 市松スライドパズル
ユーザー koyumeishikoyumeishi
提出日時 2016-03-11 22:54:12
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 1,235 bytes
コンパイル時間 865 ms
コンパイル使用メモリ 93,860 KB
実行使用メモリ 38,228 KB
最終ジャッジ日時 2023-10-25 07:09:36
合計ジャッジ時間 5,723 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 282 ms
38,228 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 361 ms
37,504 KB
testcase_14 AC 363 ms
37,700 KB
testcase_15 AC 364 ms
38,228 KB
testcase_16 AC 372 ms
38,228 KB
testcase_17 AC 371 ms
38,228 KB
testcase_18 AC 362 ms
38,228 KB
testcase_19 AC 378 ms
38,228 KB
testcase_20 AC 376 ms
38,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>
#include <random>
#include <chrono>
using namespace std;

template<class T> istream& operator >> (istream& is, vector<T>& vec){for(T& val: vec) is >> val; return is;}
template<class T> istream& operator ,  (istream& is, T& val){ return is >> val;}
template<class T> ostream& operator << (ostream& os, const vector<T>& vec){for(int i=0; i<vec.size(); i++) os << vec[i] << (i==vec.size()-1?"":" "); return os;}
template<class T> ostream& operator ,  (ostream& os, const T& val){ return os << " " << val;}
template<class T> ostream& operator >> (ostream& os, const T& val){ return os << " " << val;}

int main(){
	int h,w;
	cin >> h,w;
	int n;
	cin >> n;
	vector<string> S(n);
	vector<int> K(n);
	for(int i=0; i<n; i++) cin >> S[i] >> K[i];

	int r = 0;
	int c = 0;
	for(int i=n-1; i>=0; i--){
		if(S[i] == "R"){
			if(K[i]==r){
				c = (c-1+w)%w;
			}
		}else if(S[i] == "C"){
			if(K[i]==c){
				r = (r-1+h)%h;
			}
		}else{
			cout << "unko" << endl;
		}
	}

	cout << ((r+c)%2==0?"white":"black") << endl;
	return 0;
}
0