#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define fi first
#define se second
const ll MaxN = 1e6+5;
char a[4001][4001];
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
//your code here:
ll h,w;
cin>>h >>w;
bool flagF = false;
bool flagR = false;
for(ll i=1; i<=h; i++)
for(ll j=1; j<=w; j++)
{
cin>>a[i][j];
if(a[i][j]=='R' && !flagR) flagR = true;
if(a[i][j]=='F' && !flagF) flagF = true;
}
if(flagF && flagR) cout<<2 <<endl;
else cout<<1 <<endl;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |