結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-21 14:05:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 116 ms / 2,000 ms |
| コード長 | 616 bytes |
| コンパイル時間 | 2,214 ms |
| コンパイル使用メモリ | 196,240 KB |
| 最終ジャッジ日時 | 2025-01-09 09:05:55 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
lint h,w;std::cin>>h>>w;
lint q;std::cin>>q;
lint i=0,j=0;
std::vector<std::pair<char,lint>>queries(q);
for(lint i=0;i<q;i++){
char c;lint x;std::cin>>c>>x;
queries.at(i)={c,x};
}
std::reverse(queries.begin(),queries.end());
for(auto[c,x]:queries){
if(c=='R'&&x==i&&--j<0)j+=w;
if(c=='C'&&x==j&&--i<0)i+=h;
}
std::cout<<((i+j)%2?"black":"white")<<'\n';
}
ngtkana