結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
Ysmr_Ry
|
| 提出日時 | 2016-03-11 23:27:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 631 bytes |
| コンパイル時間 | 222 ms |
| コンパイル使用メモリ | 23,936 KB |
| 実行使用メモリ | 105,960 KB |
| 最終ジャッジ日時 | 2024-09-25 01:22:16 |
| 合計ジャッジ時間 | 4,557 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 TLE * 1 -- * 7 |
コンパイルメッセージ
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 );
| ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#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;
}
Ysmr_Ry