Submission #1234174

#TimeUsernameProblemLanguageResultExecution timeMemory
1234174mihirTracks in the Snow (BOI13_tracks)C++20
2.19 / 100
21 ms17992 KiB
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
    	ios::sync_with_stdio(false);
    	cin.tie(nullptr);	

	int h, w;
	cin >> h >> w;

	vector<string> arr(h);

	for (int i = 0; i < h; ++i) {
		cin >> arr[i];

	}

	bool found_r = false;
	bool found_f = false;
	for (int i = 0 ; i < h; ++i) {
		for (auto &c : arr[i]) {
			if (c == 'R') {
				found_r = true;
			} else if (c == 'F') {
				found_f = true;
			}

			if (found_r && found_f) {
				break;
			}
		}

	}

	if (found_r && found_f) {
		cout << 2 << endl;
	} else if (found_r || found_f) {
		cout << 1 << endl;
	} else {
		cout << 0 << endl;
	}



	return 0;
}


#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...