結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
nasadigital
|
| 提出日時 | 2016-03-11 22:48:43 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 132 ms / 2,000 ms |
| コード長 | 813 bytes |
| コンパイル時間 | 1,365 ms |
| コンパイル使用メモリ | 164,604 KB |
| 実行使用メモリ | 9,196 KB |
| 最終ジャッジ日時 | 2024-09-25 02:29:08 |
| 合計ジャッジ時間 | 3,975 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int cx=0,cy=0;
int h,w;
cin>>h>>w;
int n;
cin>>n;
vector<char> coms;
vector<int> place;
char a;
int t;
for(int ctr1=0;ctr1<n;ctr1++){
cin>>a>>t;
coms.push_back(a);
place.push_back(t);
}
reverse(coms.begin(),coms.end());
reverse(place.begin(),place.end());
for(int ctr1=0;ctr1<n;ctr1++){
if(coms[ctr1]=='R')
{
if(place[ctr1]==cx)
cy--;
}
else{
if(place[ctr1]==cy)
cx--;
}
if(cy<0)
cy+=w;
if(cx<0)
cx+=h;
}
if((cx+cy)%2)
cout<<"black"<<endl;
else cout<<"white"<<endl;
return 0;
}
nasadigital