結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-06 03:26:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 353 ms / 2,000 ms |
| コード長 | 514 bytes |
| コンパイル時間 | 1,368 ms |
| コンパイル使用メモリ | 160,208 KB |
| 実行使用メモリ | 8,840 KB |
| 最終ジャッジ日時 | 2024-09-25 03:00:24 |
| 合計ジャッジ時間 | 5,790 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int(i)=0;(i)<(n);++(i))
char S[1111111];
int K[1111111];
int main(){
int H, W, N;
cin >> H >> W >> N;
string s;
REP(i,N){
cin >> s >> K[N-i-1];
S[N-i-1] = s[0];
}
int x = 0, y = 0;
REP(i,N){
if(S[i] == 'R'){
if(y == K[i]) x = (x + W - 1) % W;
} else {
if(x == K[i]) y = (y + H - 1) % H;
}
}
cout << ((x+y)%2 ? "black" : "white") << endl;
}