結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-13 20:40:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 980 bytes |
| コンパイル時間 | 1,354 ms |
| コンパイル使用メモリ | 159,468 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 11:21:49 |
| 合計ジャッジ時間 | 4,508 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 RE * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:35:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
35 | scanf(" %c %d",&S[i],&K[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <list>
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define SQR(X) ( (X)*(X) )
#define CUBE(X) ( (X)*(X)*(X) )
// #define int ll
using namespace std;
bool test = 0;
/* ここからが本編 */
int main(){
int i,j,k,l;
int H,W;
int N;
static char S[100002];
static int K[100002];
cin >> H >> W;
cin >> N;
for(i=0;i<N;i++) {
scanf(" %c %d",&S[i],&K[i]);
}/*
rep(i,N) {
cout << S[i] << ' ' << K[i] << endl;
}*/
int x = 0,y = 0;
for(i=N-1;i>-1;i--) {
if(S[i] == 'R' && K[i] == y) {
if(x > 0) x--;
else x = W-1;
}
else if(S[i] == 'C' && K[i] == x){
if(y > 0) y--;
else y = H-1;
}
}
if((x+y) % 2) puts("black");
else puts("white");
return 0;
}