結果
問題 |
No.1613 Rush and Remove
|
ユーザー |
![]() |
提出日時 | 2021-07-21 23:07:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 693 bytes |
コンパイル時間 | 1,669 ms |
コンパイル使用メモリ | 168,928 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-17 20:13:42 |
合計ジャッジ時間 | 2,473 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 36 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define Pr pair<ll,ll> #define Tp tuple<ll,ll,ll> using Graph = vector<vector<tuple<int,int,char>>>; const ll mod = 1000000007; int main() { ll H,W; cin >> H >> W; char g[H][W]; rep(i,H){ rep(j,W){ cin >> g[i][j]; } } string ans = "First"; ll gn[W]; rep(i,W){ ll n = 0; rep(j,H){ if(g[j][i]=='o'){ n += j%2 +1; } } n %= 3; gn[i] = n; } ll judge = 0; rep(i,W) judge ^= gn[i]; if(judge==0) ans = "Second"; cout << ans << endl; }