結果

問題 No.351 市松スライドパズル
ユーザー HeyHey0111HeyHey0111
提出日時 2016-03-13 02:41:06
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 735 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 61,540 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2023-10-26 03:16:54
合計ジャッジ時間 6,171 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 232 ms
11,520 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 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 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 316 ms
11,520 KB
testcase_14 AC 319 ms
11,520 KB
testcase_15 AC 327 ms
11,520 KB
testcase_16 AC 324 ms
11,520 KB
testcase_17 AC 319 ms
11,520 KB
testcase_18 AC 318 ms
11,520 KB
testcase_19 AC 322 ms
11,520 KB
testcase_20 AC 323 ms
11,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
typedef struct hoge{
    char c;
    int n;
    hoge(){
        c='a';
        n=0;
    }
    hoge(char c,int n):c(c),n(n){};
}hoge;
int main(void){
    int n,h,w;
    cin >> h >> w;
    cin >> n;
    vector<hoge> ho;
    
    for(int i=0;i<n;i++){
        int nn;
        char c;
        cin >> c >> nn;
        ho.push_back(hoge(c,nn));
        //cin >> ho[i].c >> ho[i].n;
    }
    int x=0,y=0;
    while(!ho.empty()){
        if(ho.back().c=='R'&&x==ho.back().n){
            y=(y+h-1)%h;
        }else if(ho.back().c=='C'&&y==ho.back().n){
            x=(x+w-1)%w;
        }
        ho.pop_back();
    }
    cout <<((x+y)%2  ? "black" : "white" )<<endl;
    return 0;
}
0