結果

問題 No.351 市松スライドパズル
ユーザー aaaaaaiu
提出日時 2019-08-15 01:46:59
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 1,862 ms
コンパイル使用メモリ 192,160 KB
最終ジャッジ日時 2025-01-07 11:50:48
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 6 WA * 11
権限があれば一括ダウンロードができます

ソースコード

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) r=(r-1+h)%h;
        else if (a[i]=='C'&&b[i]==c) c=(c-1+w)&w;
    }
    if ((r+c)%2==0) puts("white");
    else puts("black");
    return 0;
}
0