結果
問題 | No.1613 Rush and Remove |
ユーザー |
![]() |
提出日時 | 2021-07-21 23:18:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 666 bytes |
コンパイル時間 | 4,512 ms |
コンパイル使用メモリ | 231,592 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-17 20:35:29 |
合計ジャッジ時間 | 4,493 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 36 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using ll=long long; using Graph=vector<vector<pair<int,int>>>; #define MAX 100 #define MOD 1000000007 #define INF 1000000000000000000 int main(){ int H,W; cin>>H>>W; vector<vector<char>> B(H,vector<char>(W)); for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ cin>>B[i][j]; } } int x=0; for(int j=0;j<W;j++){ int res=1; int sum=0; for(int i=0;i<H;i++){ if(B[i][j]=='o'){ sum+=res; sum%=3; } res=2*res%3; } x^=sum; } if(x==0){ cout<<"Second"<<endl; }else{ cout<<"First"<<endl; } }