結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2025-03-17 21:03:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 569 bytes |
コンパイル時間 | 2,009 ms |
コンパイル使用メモリ | 194,180 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-17 21:03:43 |
合計ジャッジ時間 | 7,274 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 14 WA * 3 |
ソースコード
#include<bits/stdc++.h> #define int long long using namespace std; const int N=1000010; int n,m,q; int row[N],col[N]; void solve(){ cin>>n>>m>>q; while(q--){ string op; cin>>op; int x; cin>>x; if(op=="R")row[x]--; else col[x]--; } int idx=(row[0]%m+m)%m; int idy=(col[0]%n+n)%n; if(idx%2==idy%2)cout<<"white\n"; else cout<<"black\n"; for(int i=0;i<n;i++)row[i]=0; for(int i=0;i<m;i++)col[i]=0; return; } signed main(){ // freopen("puzzle.in","r",stdin); // freopen("puzzle.out","w",stdout); int T=1; // cin>>T; while(T--)solve(); return 0; }