結果

問題 No.351 市松スライドパズル
ユーザー Kmcode1Kmcode1
提出日時 2016-03-11 22:33:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,092 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 93,400 KB
実行使用メモリ 11,780 KB
最終ジャッジ日時 2023-10-25 05:34:23
合計ジャッジ時間 3,585 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
11,780 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 145 ms
11,780 KB
testcase_14 WA -
testcase_15 AC 147 ms
11,780 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 149 ms
11,780 KB
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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'){
			y += w - 1;
			y %= w;
		}
		else{
			x += h - 1;
			x %= h;
		}
	}
	int k = (x + y);
	k %= 2;
	if (k == 0){
		puts("white");
	}
	else{
		puts("black");
	}
	return 0;
}
0