結果

問題 No.351 市松スライドパズル
ユーザー firiexpfiriexp
提出日時 2019-03-02 17:57:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 933 bytes
コンパイル時間 911 ms
コンパイル使用メモリ 94,216 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2023-10-11 21:29:13
合計ジャッジ時間 5,315 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
10,880 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 129 ms
10,680 KB
testcase_14 AC 131 ms
10,876 KB
testcase_15 AC 132 ms
10,756 KB
testcase_16 AC 133 ms
10,728 KB
testcase_17 AC 128 ms
10,756 KB
testcase_18 AC 129 ms
10,876 KB
testcase_19 AC 132 ms
10,756 KB
testcase_20 AC 132 ms
10,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <limits>

static const int MOD = 1000000007;
using ll = int64_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int h, w, n;
    cin >> h >> w >> n;
    int a = 0, b = 0;
    vector<pair<char,int>> v(n);
    for (int i = 0; i < n; ++i) {
        scanf(" %c %d", &v[i].first, &v[i].second);
    }
    reverse(v.begin(), v.end());
    for (int i = 0; i < n; ++i) {
        int c, d; tie(c, d) = v[i];
        if(c == 'R'){
            if(d == a) {
                b--;
                if(b < 0) b += h;
            }
        }else {
            if(d == b) {
                a--;
                if(a < 0) a += w;
            }
        }
    }
    puts((a+b)%2 ?  "black": "white");
    return 0;
}
0