結果

問題 No.351 市松スライドパズル
ユーザー finefine
提出日時 2016-03-12 18:52:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 619 ms
コンパイル使用メモリ 55,068 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-25 08:08:58
合計ジャッジ時間 2,771 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 97 ms
4,348 KB
testcase_14 WA -
testcase_15 AC 100 ms
4,348 KB
testcase_16 AC 101 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 95 ms
4,348 KB
testcase_19 AC 98 ms
4,348 KB
testcase_20 AC 98 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,h,w,k,a = 0,b = 0;
    char c;
    cin >> h >> w;
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> c >> k;
        if (c == 'R' && k == a) {
            b = (b + 1) % w;
        } else if (c == 'C' && k == b) {
            a = (a + 1) % h;
        }
    }
    if ((a * w + b) % 2 == 0) {
        cout << "white" << "\n";
    } else {
        cout << "black" << "\n";
    }
    return 0;
}
0