結果

問題 No.351 市松スライドパズル
ユーザー Ysmr_RyYsmr_Ry
提出日時 2016-03-11 23:27:46
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 631 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 23,940 KB
実行使用メモリ 104,080 KB
最終ジャッジ日時 2023-10-25 05:58:01
合計ジャッジ時間 4,995 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<cstdio>
#define rep(i,a) for(int i=0;i<(a);++i)
#define repd(i,a) for(int i=(a);i>=0;--i)

const int MAX_H = 10000, MAX_W = 10000;

int H, W;
int N;
bool fld[MAX_H][MAX_W];

int main()
{
	scanf( "%d%d%d", &H, &W, &N );

	rep( i, H ) rep( j, W )
		fld[i][j] = (i+j)&1;

	rep( i, N )
	{
		char S[2];
		int K;

		scanf( "%s%d", S, &K );

		if( *S == 'R' )
		{
			bool f = fld[K][W-1];
			repd( j, W-2 )
				fld[K][(j+1)%W] = fld[K][j];

			fld[K][0] = f;
		}
		else
		{
			bool f = fld[H-1][K];
			repd( i, H-2 )
				fld[(i+1)%H][K] = fld[i][K];
			fld[0][K] = f;
		}
	}

	puts( fld[0][0] ? "black" : "white" );

	return 0;
}
0