結果

問題 No.351 市松スライドパズル
ユーザー ldsybldsyb
提出日時 2016-03-12 16:27:00
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 56,052 KB
実行使用メモリ 8,312 KB
最終ジャッジ日時 2023-10-25 08:07:27
合計ジャッジ時間 4,976 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 227 ms
8,312 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 WA -
testcase_13 AC 308 ms
8,200 KB
testcase_14 AC 306 ms
8,228 KB
testcase_15 AC 317 ms
8,312 KB
testcase_16 AC 313 ms
8,312 KB
testcase_17 AC 306 ms
8,312 KB
testcase_18 AC 310 ms
8,312 KB
testcase_19 AC 313 ms
8,312 KB
testcase_20 AC 320 ms
8,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
   int h,w,n,x = 0,y = 0;
   cin >> h >> w >> n;
   char c[n];
   int k[n];
   for(int i = 0;i < n;i++) cin >> c[i] >> k[i];
   for(int i = n;i--;){
      if(c[i] == 'R' && k[i] == y) x = (x + w - 1) % w;
      else if(c[i] == 'C' && k[i] == x) y = (y + h - 1) % w;
   }
   cout << (x + y & 1 ? "black" : "white") << endl;
}
0