#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#define ll long long
#define fori(i,j,k) for(ll i=j; i<=k;i++)
#define study ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define all(s) s.begin(),s.end()
#define ins insert
#define ss second
#define ff first
ll sz=1e6+10;
ll INF=1e12;
ll mod=1e9+7;
void work(){
ll h,w;
cin>>h>>w;
vector<vector<ll>>v(h+10,vector<ll>(w+10));
ll fox=0,rabbit=0;
fori(i,1,h){
string s;
cin>>s;
for(auto x: s){
if(x=='F'){
v[i][x+1]=1;
fox=1;
}
if(x=='R'){
v[i][x+1]=2;
rabbit=1;
}
}
}
cout<<fox+rabbit<<endl;
}
int main()
{
study;
ll t=1;
//cin>>t;
fori(i,1,t)
work();
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |