結果

問題 No.351 市松スライドパズル
ユーザー hotpepsihotpepsi
提出日時 2016-03-17 00:37:32
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 661 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 57,496 KB
実行使用メモリ 107,636 KB
最終ジャッジ日時 2024-04-08 16:40:29
合計ジャッジ時間 4,825 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         scanf("%d %d", &H, &W);
      |         ~~~~~^~~~~~~~~~~~~~~~~
main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         scanf("%d", &N);
      |         ~~~~~^~~~~~~~~~
main.cpp:22:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |                 scanf("%s %d", S, &K);
      |                 ~~~~~^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <cstring>

using namespace std;

char b[10000][10000];

int main(int argc, char *argv[])
{
	int H, W, N;
	scanf("%d %d", &H, &W);
	scanf("%d", &N);
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			b[i][j] = (i + j) % 2;
		}
	}
	for (int i = 0; i < N; ++i) {
		char S[64];
		int K;
		scanf("%s %d", S, &K);
		if (S[0] == 'C') {
			char c = b[H - 1][K];
			for (int j = 1; j < H; ++j) {
				b[j][K] = b[j - 1][K];
			}
			b[0][K] = c;
		} else {
			char c = b[K][W - 1];
			memmove(&(b[K][1]), &(b[K][0]), W - 1);
			b[K][0] = c;
		}
	}
	cout << (b[0][0] ? "black" : "white") << endl;
	return 0;
}
0