結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
![]() |
提出日時 | 2025-03-17 20:57:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 2,015 ms |
コンパイル使用メモリ | 192,980 KB |
実行使用メモリ | 7,640 KB |
最終ジャッジ日時 | 2025-03-17 20:57:43 |
合計ジャッジ時間 | 6,681 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 WA * 4 |
ソースコード
#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]%n+n)%n; int idy=(col[0]%m+m)%m; 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(){ int T=1; // cin>>T; while(T--)solve(); return 0; }