結果
問題 | No.1613 Rush and Remove |
ユーザー |
![]() |
提出日時 | 2024-08-09 20:38:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 809 bytes |
コンパイル時間 | 1,217 ms |
コンパイル使用メモリ | 104,696 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-08-09 20:38:23 |
合計ジャッジ時間 | 2,628 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 36 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> using namespace std; using ll = long long; #include<map> int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int h,w; cin>>h>>w; vector<string> s(h); for(int i = 0;i<h;i++) cin>>s[i]; int now = 0; for(int i = 0;i<w;i++){ int a = 0; int b = 0; for(int j = 0;j<h;j++){ if(s[j][i]=='.') continue; if(j%2==0) a++; else b++; } int mn = min(a,b); a -= mn; b -= mn; int c = a + b; if(c==0) continue; int g = 0; if(c%3==1) g = 1; else if(c%3==2) g = 2; if(b>0) g = 3 - g; g %= 3; now ^= g; } if(now==0) cout<<"Second\n"; else cout<<"First\n"; }