#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";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
724 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
420 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
324 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
372 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
424 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
420 KB |
Output isn't correct |
15 |
Incorrect |
2 ms |
724 KB |
Output isn't correct |
16 |
Incorrect |
2 ms |
724 KB |
Output isn't correct |
17 |
Incorrect |
2 ms |
808 KB |
Output isn't correct |
18 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
456 KB |
Output isn't correct |
2 |
Incorrect |
7 ms |
3412 KB |
Output isn't correct |
3 |
Incorrect |
53 ms |
31796 KB |
Output isn't correct |
4 |
Incorrect |
13 ms |
7792 KB |
Output isn't correct |
5 |
Incorrect |
27 ms |
18224 KB |
Output isn't correct |
6 |
Incorrect |
56 ms |
31704 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
456 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
13 |
Incorrect |
7 ms |
3412 KB |
Output isn't correct |
14 |
Incorrect |
4 ms |
2124 KB |
Output isn't correct |
15 |
Incorrect |
5 ms |
2252 KB |
Output isn't correct |
16 |
Incorrect |
3 ms |
1596 KB |
Output isn't correct |
17 |
Incorrect |
16 ms |
8260 KB |
Output isn't correct |
18 |
Incorrect |
17 ms |
8200 KB |
Output isn't correct |
19 |
Incorrect |
14 ms |
7888 KB |
Output isn't correct |
20 |
Incorrect |
12 ms |
7104 KB |
Output isn't correct |
21 |
Incorrect |
33 ms |
18636 KB |
Output isn't correct |
22 |
Incorrect |
22 ms |
17992 KB |
Output isn't correct |
23 |
Incorrect |
34 ms |
15532 KB |
Output isn't correct |
24 |
Incorrect |
34 ms |
18244 KB |
Output isn't correct |
25 |
Incorrect |
69 ms |
32076 KB |
Output isn't correct |
26 |
Correct |
26 ms |
24460 KB |
Output is correct |
27 |
Incorrect |
39 ms |
31804 KB |
Output isn't correct |
28 |
Incorrect |
56 ms |
31772 KB |
Output isn't correct |
29 |
Incorrect |
56 ms |
31808 KB |
Output isn't correct |
30 |
Incorrect |
47 ms |
31052 KB |
Output isn't correct |
31 |
Incorrect |
61 ms |
20400 KB |
Output isn't correct |
32 |
Incorrect |
41 ms |
31796 KB |
Output isn't correct |