結果

問題 No.351 市松スライドパズル
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-15 01:49:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 2,045 ms
コンパイル使用メモリ 201,180 KB
実行使用メモリ 5,744 KB
最終ジャッジ日時 2023-10-19 18:23:04
合計ジャッジ時間 3,637 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int h,w,n;
    cin>>h>>w>>n;
    int a[n],b[n];
    for (int i=0;i<n;i++) cin>>a[i]>>b[i];
    int r=0;
    int c=0;
    for (int i=n-1;i>=0;i--) {
        if (a[i]=='R'&&b[i]==r) c=(c-1+w)%w;
        else if (a[i]=='C'&&b[i]==c) r=(r-1+h)%h;
    }
    if ((r+c)%2==0) puts("white");
    else puts("black");
    return 0;
}
0