結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2016-03-27 22:25:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,143 bytes |
| コンパイル時間 | 709 ms |
| コンパイル使用メモリ | 74,644 KB |
| 実行使用メモリ | 400,804 KB |
| 最終ジャッジ日時 | 2024-10-02 05:22:32 |
| 合計ジャッジ時間 | 5,458 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 WA * 1 TLE * 1 -- * 7 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <limits.h>
#include <time.h>
#include <string>
#include <string.h>
#include <sstream>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
const int WHITE = 0;
const int BLACK = 1;
int main(){
int h, w;
cin >> h >> w;
int n;
cin >> n;
int field[h][w];
int val = WHITE;
for(int y = 0; y < h; y++){
for(int x = 0; x < w; x++){
field[y][x] = val;
val ^= 1;
}
}
char s;
int k;
for(int i = 0; i < n; i++){
cin >> s >> k;
if(s == 'R'){
int num[w];
for(int x = 0; x < w; x++){
num[x] = field[k][(x+w-1)%w];
}
for(int x = 0; x < w; x++){
field[k][x] = num[x];
}
}else{
int num[h];
for(int y = 0; y < h; y++){
num[y] = field[(y+h-1)%h][k];
}
for(int y = 0; y < h; y++){
field[y][k] = num[y];
}
}
}
if(field[0][0] == WHITE){
cout << "white" << endl;
}else{
cout << "black" << endl;
}
return 0;
}
siman