This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int h,w;
    cin >> h >> w;
    vector<string> field (h);
    for (int i=0;i<h;i++) {
        string x;
        cin >> x;
        field[i]=x;  
    }
    bool f=false;
    bool r=false;
    int ret=0;
    for (int i=0;i<h;i++) {
        for (int j=0;j<w;j++) {
            if(field[i][j]=='F'&&!f){
                f=true;
                ret++;
            }
            if(field[i][j]=='R'&&!r) {
                r=true;
                ret++;
            }
        }
    }
    cout << ret << "\n";
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |