結果

問題 No.351 市松スライドパズル
ユーザー BantakoBantako
提出日時 2018-07-10 20:11:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 1,485 ms
コンパイル使用メモリ 167,288 KB
実行使用メモリ 8,120 KB
最終ジャッジ日時 2023-10-11 20:35:28
合計ジャッジ時間 5,987 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 209 ms
7,980 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,352 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 1 ms
4,348 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 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 289 ms
7,932 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 288 ms
7,980 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    ll H,W,N;
    cin >> H >> W >> N;
    vector<int> V(N);
    vector<char> C(N);
    rep(i,0,N){
        cin >> C[i] >> V[i];
    }
    int y = 0,x = 0;
    for(int i = N-1;i >= 0;i--){
        if(V[i] == x || V[i] == y){
            if(C[i] == 'R')x = (x + W - 1) % W;
            else           y = (y + H - 1) % H;
        }
    }
    //cout << x << " " << y << endl;
    if((x + y) & 1)cout << "black" << endl;
    else           cout << "white" << endl;
    
}
0