Submission #1370681

#TimeUsernameProblemLanguageResultExecution timeMemory
1370681Ekber_EkberTracks in the Snow (BOI13_tracks)C++20
2.19 / 100
44 ms18204 KiB
#include <bits/stdc++.h>
// #ifndef ONLINE_JUDGE
//     #include <debug.h>
// #else
//     #define debug(...)
// #endif
#define GOOD_LUCK ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define all(v) v.begin(), v.end()
using namespace std;

constexpr int MAX = 2e+5 + 1, INF = 2e+16, MOD = 1e+9 + 7, K = 31;

void _() {
    int n, m;
    cin >> n >> m;
    vector <string> v(n);
    for (auto &i : v) cin >> i;
    bool is1 = 0, is2 = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (v[i][j] == 'F') is1 = 1;
            if (v[i][j] == 'R') is2 = 1;
        }
    }
    if (is1 && is2) cout << 2;
    else if (!is1 && !is2) cout << 0;
    else cout << 1;
}

signed main() {

    GOOD_LUCK

    int tests=1;
    // cin >> tests;
    for (int i=1; i <= tests; i++) {
        _();
        cout << endl;
    }

    return 0;
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...