結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2016-03-11 23:29:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 628 bytes |
| コンパイル時間 | 447 ms |
| コンパイル使用メモリ | 59,316 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 01:23:56 |
| 合計ジャッジ時間 | 4,623 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 6 |
ソースコード
#include<iostream>
#include<vector>
int main() {
int h, w, n;
std::cin >> h >> w >> n;
std::vector<int> hori(h), v(w);
for (int i = 0; i < n; i++) {
char c;
int k;
std::cin >> c >> k;
if (c == 'R') {
hori[k]--;
if (hori[k] < 0) hori[k] = w - 1;
} else {
v[k]--;
if (v[k] < 0) v[k] = h - 1;
}
}
if (hori[0] % 2 == 0) {
// 白
if (v[hori[0]] % 2 == 0) {
std::cout << "white" << std::endl;
} else {
std::cout << "black" << std::endl;
}
} else {
if (v[hori[0]] % 2 == 0) {
std::cout << "black" << std::endl;
} else {
std::cout << "white" << std::endl;
}
}
return 0;
}
hanorver