結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2016-04-03 18:43:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 636 bytes |
コンパイル時間 | 559 ms |
コンパイル使用メモリ | 55,496 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-10-02 12:39:40 |
合計ジャッジ時間 | 2,788 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 11 WA * 6 |
ソースコード
#include <string> #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int h, w; //不要なワーク int input; //入力 bool rBit = true, cBit = true; //Rbit, Cbit string str1, str2; //文字列 cin >> h >> w; cin >> input; while(input) { cin >> str1 >> str2; str1 += str2; if(str1 == "R0") { if(!(w & 1)) { rBit = !rBit; ++w; } rBit = !rBit; } if(str1 == "C0") { if(!(h & 1)) { cBit = !cBit; ++h; } cBit = !cBit; } --input; } cout << ((rBit ^ cBit) ? ("black") : ("white")) << endl; return 0; }