#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define all(x) x.begin(), x.end()
template<class A, class B>
bool chmin(A &a, const B &b) {
return a > b ? (a = b) == b : false;
} template<class A, class B>
bool chmax(A &a, const B &b) {
return a < b ? (a = b) == b : false;
}
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n, m; cin >> n >> m;
vector<string> s(n);
for (int i = 0; i < n; ++i) {
cin >> s[i];
}
int f = 0, r = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
if (s[i][j] == 'F') f = 1;
if (s[i][j] == 'R') r = 1;
}
}
cout << f + r;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |