#include <bits/stdc++.h>
using namespace std;
#define __Master_Moon__ int main()
#define ll long long
#define el "\n"
#define fi first
#define sq(x) (x)*(x)
#define se second
#define pub push_back
#define puf push_front
#define pii pair <int, int>
#define pll pair <long long, long long>
#define piii pair <int, pair <int, int>>
#define iiii pair <int, pair <int, pair <int, int>>>
#define plll pair <long long, pair <long long, long long>>
#define FOR(i, a, b) for(ll i = (a);i <=(b);i++)
#define FO(i, a, b) for(int i = (a);i >= (b);i--)
#define REP(i, n) for(int i = 0;i < (n);i++)
long const maxn = 1e6+5;
int n,m,ans,cnt[2];
void solve()
{
cin >> n >> m;
FOR(i,1,n)
{
FOR(j,1,m)
{
char c;
cin >> c;
if(c == 'F') cnt[0]++;
if(c == 'R') cnt[1]++;
}
}
ans += (cnt[0] != 0);
ans += (cnt[1] != 0);
cout << ans;
}
__Master_Moon__
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
solve();
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |