結果

問題 No.351 市松スライドパズル
ユーザー vjudge1
提出日時 2025-03-14 17:44:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 728 bytes
コンパイル時間 4,183 ms
コンパイル使用メモリ 273,676 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-14 17:44:45
合計ジャッジ時間 5,945 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 3 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int maxn=1e6+10,maxm=1e3+10,mod=998244353;
int t,n,m,x,y,u,v,ans=1e18,arr[maxn],pos[maxn];
struct node
{
	char x;
	int y;
}e[maxn];
signed main()
{
//	freopen("puzzle.in","r",stdin);
//	freopen("puzzle.out","w",stdout);
	cin>>t;
	while(t--)
	{
		cin>>u>>v>>n;
		pair<int,int>p;
		for(int i=1;i<=n;i++)
		{
		    cin>>e[i].x>>e[i].y;
		}
		for(int i=n;i;i--)
		{
			if(e[i].x=='R')
			{
				if(p.second==e[i].y)
				{
					p.first=(p.first+n+1)%n;
				}
			}
			else
			{
				if(p.first==e[i].x)
				{
					p.second=(p.second+n+1)%n;
				}				
			}
		}
		if(p.first+p.second&1)
		{
			cout<<"black\n";
		}
		else
		{
			cout<<"white\n";
		}
	}
	return 0;
}
0