/* Author : Mychecksdead */
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef long double ld;
#define MOD (1000000000+7)
#define MOD1 (998244353)
#define PI 3.1415926535
#define pb push_back
#define setp() cout << setprecision(15)
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " is " << x << '\n';
const int N = 1e6+100, M = 1e5+10, F = 2147483646, K = 20;
int n, m;
string s[N];
void solve(){
cin >> n >> m;
for(int i = 0; i < n; ++i) cin >> s[i];
bool a = 0, b = 0;
for(int i = 0; i < n; ++i){
for(int j = 0; j < m; ++j){
if(s[i][j] == 'R') a = 1;
if(s[i][j] == 'F') b = 1;
}
}
if(a&b) cout << 2;
else if(a|b) cout << 1;
else cout << 0;
}
int main(){
cin.tie(0); ios::sync_with_stdio(0);
int T = 1, aa;
// cin >> T;aa=T;
while(T--){
// cout << "Case #" << aa-T << ": ";
solve();
cout << '\n';
}
return 0;
}
Compilation message
tracks.cpp: In function 'int main()':
tracks.cpp:41:16: warning: unused variable 'aa' [-Wunused-variable]
41 | int T = 1, aa;
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
17 ms |
32084 KB |
Output isn't correct |
2 |
Incorrect |
17 ms |
31612 KB |
Output isn't correct |
3 |
Incorrect |
15 ms |
31572 KB |
Output isn't correct |
4 |
Incorrect |
17 ms |
31828 KB |
Output isn't correct |
5 |
Incorrect |
17 ms |
31776 KB |
Output isn't correct |
6 |
Incorrect |
16 ms |
31528 KB |
Output isn't correct |
7 |
Incorrect |
16 ms |
31532 KB |
Output isn't correct |
8 |
Incorrect |
17 ms |
31572 KB |
Output isn't correct |
9 |
Incorrect |
17 ms |
31604 KB |
Output isn't correct |
10 |
Incorrect |
16 ms |
31704 KB |
Output isn't correct |
11 |
Incorrect |
17 ms |
31684 KB |
Output isn't correct |
12 |
Incorrect |
18 ms |
31780 KB |
Output isn't correct |
13 |
Incorrect |
16 ms |
31704 KB |
Output isn't correct |
14 |
Incorrect |
17 ms |
31700 KB |
Output isn't correct |
15 |
Incorrect |
20 ms |
32084 KB |
Output isn't correct |
16 |
Incorrect |
18 ms |
32092 KB |
Output isn't correct |
17 |
Incorrect |
17 ms |
32032 KB |
Output isn't correct |
18 |
Incorrect |
16 ms |
31836 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
17 ms |
31648 KB |
Output isn't correct |
2 |
Incorrect |
23 ms |
34840 KB |
Output isn't correct |
3 |
Incorrect |
78 ms |
57992 KB |
Output isn't correct |
4 |
Incorrect |
31 ms |
39112 KB |
Output isn't correct |
5 |
Incorrect |
41 ms |
50240 KB |
Output isn't correct |
6 |
Incorrect |
83 ms |
58948 KB |
Output isn't correct |
7 |
Incorrect |
17 ms |
31572 KB |
Output isn't correct |
8 |
Incorrect |
17 ms |
31652 KB |
Output isn't correct |
9 |
Incorrect |
17 ms |
31812 KB |
Output isn't correct |
10 |
Incorrect |
16 ms |
31628 KB |
Output isn't correct |
11 |
Incorrect |
16 ms |
31648 KB |
Output isn't correct |
12 |
Incorrect |
16 ms |
31572 KB |
Output isn't correct |
13 |
Incorrect |
23 ms |
34728 KB |
Output isn't correct |
14 |
Incorrect |
20 ms |
33440 KB |
Output isn't correct |
15 |
Incorrect |
20 ms |
33552 KB |
Output isn't correct |
16 |
Incorrect |
20 ms |
32916 KB |
Output isn't correct |
17 |
Incorrect |
33 ms |
39820 KB |
Output isn't correct |
18 |
Incorrect |
31 ms |
39672 KB |
Output isn't correct |
19 |
Incorrect |
36 ms |
39148 KB |
Output isn't correct |
20 |
Incorrect |
36 ms |
38516 KB |
Output isn't correct |
21 |
Incorrect |
53 ms |
50696 KB |
Output isn't correct |
22 |
Incorrect |
40 ms |
50204 KB |
Output isn't correct |
23 |
Incorrect |
51 ms |
47512 KB |
Output isn't correct |
24 |
Incorrect |
57 ms |
50208 KB |
Output isn't correct |
25 |
Incorrect |
77 ms |
64944 KB |
Output isn't correct |
26 |
Correct |
48 ms |
53660 KB |
Output is correct |
27 |
Incorrect |
58 ms |
58896 KB |
Output isn't correct |
28 |
Incorrect |
78 ms |
59032 KB |
Output isn't correct |
29 |
Incorrect |
75 ms |
57548 KB |
Output isn't correct |
30 |
Incorrect |
69 ms |
58192 KB |
Output isn't correct |
31 |
Incorrect |
88 ms |
52660 KB |
Output isn't correct |
32 |
Incorrect |
58 ms |
57444 KB |
Output isn't correct |