結果

問題 No.351 市松スライドパズル
ユーザー rogi52rogi52
提出日時 2022-10-03 00:27:47
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 2,038 ms
コンパイル使用メモリ 202,772 KB
実行使用メモリ 10,824 KB
最終ジャッジ日時 2023-08-26 21:57:24
合計ジャッジ時間 5,827 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    int H,W,N; cin >> H >> W >> N;
    vector<pair<char,int>> query(N);
    for(auto &[s, t] : query) cin >> s >> t;
    reverse(query.begin(), query.end());

    int i = 0, j = 0;
    for(auto [s, t] : query) {
        if(s == 'C' && t == j) {
            i = (i - 1 + H) % H;
        } else if(t == i) {
            j = (j - 1 + W) % W;
        }
    }

    cout << ((i + j) % 2 == 0 ? "white" : "black") << endl;
}
0