結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-28 14:38:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 622 bytes |
| コンパイル時間 | 1,644 ms |
| コンパイル使用メモリ | 170,076 KB |
| 実行使用メモリ | 42,368 KB |
| 最終ジャッジ日時 | 2024-11-27 12:37:44 |
| 合計ジャッジ時間 | 6,714 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 11 WA * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const string msg[] = { "white", "black" };
signed main(){
int H, W; cin >> H >> W;
int N; cin >> N;
vector< pair< string, int > > opx( N );
for( int i = 0; i < N; ++i )
cin >> opx[ i ].first >> opx[ i ].second;
int x = 0, y = 0;
for( int i = N - 1; i >= 0; --i ){
string op = opx[ i ].first;
int v = opx[ i ].second;
if( op[ 0 ] == 'R' ){
if( x != v ) continue;
x = ( x - 1 + W ) % W;
} else{
if( y != v ) continue;
y = ( y - 1 + H ) % H;
}
}
cout << msg[ ( ( x & 1 ) + ( y & 1 ) ) & 1 ] << endl;
return 0;
}