結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
|
提出日時 | 2016-03-13 20:34:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 864 bytes |
コンパイル時間 | 1,378 ms |
コンパイル使用メモリ | 157,272 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 11:20:32 |
合計ジャッジ時間 | 4,444 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 5 WA * 3 RE * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:35:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘char*’ [-Wformat=] 35 | scanf(" %c %d",&S[i],&K[i]); | ~^ ~~~~~ | | | | int* char* | %hhd 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; char S[100002]; char K[100002]; cin >> H >> W; cin >> N; for(i=0;i<N;i++) { scanf(" %c %d",&S[i],&K[i]); } int x = 0,y = 0; for(i=N-1;i>-1;i--) { if(S[i] == 'R') { if(x < W-1) x++; else x = 0; } else { if(y < H-1) y++; else y = 0; } } if((x+y) % 2) puts("black"); else puts("white"); return 0; }