結果

問題 No.351 市松スライドパズル
ユーザー Kmcode1Kmcode1
提出日時 2016-03-11 22:34:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 1,146 bytes
コンパイル時間 1,024 ms
コンパイル使用メモリ 93,244 KB
実行使用メモリ 11,780 KB
最終ジャッジ日時 2023-10-25 07:06:18
合計ジャッジ時間 3,437 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
11,780 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 1 ms
4,372 KB
testcase_04 AC 1 ms
4,372 KB
testcase_05 AC 1 ms
4,372 KB
testcase_06 AC 1 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 2 ms
4,372 KB
testcase_09 AC 2 ms
4,372 KB
testcase_10 AC 1 ms
4,372 KB
testcase_11 AC 1 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 142 ms
11,780 KB
testcase_14 AC 143 ms
11,780 KB
testcase_15 AC 145 ms
11,780 KB
testcase_16 AC 142 ms
11,780 KB
testcase_17 AC 141 ms
11,780 KB
testcase_18 AC 140 ms
11,780 KB
testcase_19 AC 142 ms
11,780 KB
testcase_20 AC 145 ms
11,780 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In constructor ‘st::st()’:
main.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   47 |                 scanf("%s%d", buf, &k);
      |                 ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
using namespace std;


int h;
int w;

char buf[3];

struct st{

	char s;
	int k;

	st(){
		scanf("%s%d", buf, &k);
		s = buf[0];
	}

};

vector<st> v;

int main(){
	cin >> h >> w;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		v.push_back(st());
	}
	reverse(v.begin(), v.end());
	int x = 0;
	int y = 0;
	for (int i = 0; i < v.size(); i++){
		if (v[i].s == 'R'&&v[i].k==x){
			y += w - 1;
			y %= w;
		}
		else{
			if (v[i].s == 'C'&&v[i].k == y){
				x += h - 1;
				x %= h;
			}
		}
	}
	int k = (x + y);
	k %= 2;
	if (k == 0){
		puts("white");
	}
	else{
		puts("black");
	}
	return 0;
}
0