結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-11 23:17:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 691 bytes |
| コンパイル時間 | 1,430 ms |
| コンパイル使用メモリ | 161,344 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2024-09-25 01:21:20 |
| 合計ジャッジ時間 | 5,291 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
22 | rep(i,n) scanf(" %c %d",&v[i].fi,&v[i].sc);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second
typedef pair<char,int> p;
int main()
{
int i;
int h,w,n;
cin >>h >>w >>n;
vector<p> v(n);
rep(i,n) scanf(" %c %d",&v[i].fi,&v[i].sc);
int x=0,y=0;
for(i=n-1; i>=0; --i)
{
printf("%d\n", i);
char s=v[i].fi;
int k=v[i].sc;
if(s=='R' && k==x) y=(y+w-1)%w;
else if(s=='C' && k==y) x=(x+h-1)%h;
//printf(" %d %d\n",x,y);
}
string ans="white";
if((x+y)%2==1) ans="black";
std::cout << ans << std::endl;
}