#include <bits/stdc++.h>
using namespace std;
//------------------------------DEFINE------------------------------
//******************************************************************
#define IOS ios_base::sync_with_stdio(false); cin.tie(0),cout.tie(0)
#define ll long long
#define pb push_back
#define F first
#define S second
#define INF 1e18
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define OK cout<<"Ok"<<endl;
#define MOD (ll)(1e9+7)
#define endl "\n"
//******************************************************************
//----------------------------FUNCTION------------------------------
//******************************************************************
ll gcd(ll a,ll b){
if(a>b) swap(a,b);
if(a==0) return a+b;
return gcd(b%a,a);
}
ll lcm(ll a,ll b){
return a/gcd(a,b)*b;
}
bool is_prime(ll n){
ll k=sqrt(n);
if(n==2) return true;
if(n<2||n%2==0||k*k==n) return false;
for(int i=3;i<=k;i+=2){
if(n%i==0){
return false;
}
}
return true;
}
//*****************************************************************
//--------------------------MAIN-CODE------------------------------
const int mxn=4000+5;
int t=1,n,m,a,b;
char arr[mxn][mxn];
void solve(){
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>arr[i][j];
if(arr[i][j]=='R'){
a=1;
}
else if(arr[i][j]!='.'){
b=1;
}
}
}
cout<<a+b<<endl;
}
int main(){
IOS;
//cin>>t;
while(t--){
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
2124 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
332 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
4 |
Incorrect |
5 ms |
2124 KB |
Output isn't correct |
5 |
Incorrect |
4 ms |
1356 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
588 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
1228 KB |
Output isn't correct |
11 |
Incorrect |
2 ms |
1100 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
1356 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
1356 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
1356 KB |
Output isn't correct |
15 |
Incorrect |
7 ms |
2252 KB |
Output isn't correct |
16 |
Incorrect |
7 ms |
2140 KB |
Output isn't correct |
17 |
Incorrect |
7 ms |
2124 KB |
Output isn't correct |
18 |
Incorrect |
4 ms |
2124 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
15180 KB |
Output isn't correct |
2 |
Incorrect |
31 ms |
5092 KB |
Output isn't correct |
3 |
Incorrect |
282 ms |
15960 KB |
Output isn't correct |
4 |
Incorrect |
73 ms |
7792 KB |
Output isn't correct |
5 |
Incorrect |
143 ms |
11972 KB |
Output isn't correct |
6 |
Incorrect |
298 ms |
15908 KB |
Output isn't correct |
7 |
Incorrect |
9 ms |
15908 KB |
Output isn't correct |
8 |
Incorrect |
8 ms |
15260 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
332 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
11 |
Incorrect |
8 ms |
15564 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
844 KB |
Output isn't correct |
13 |
Incorrect |
32 ms |
5128 KB |
Output isn't correct |
14 |
Incorrect |
19 ms |
3848 KB |
Output isn't correct |
15 |
Incorrect |
22 ms |
4172 KB |
Output isn't correct |
16 |
Incorrect |
14 ms |
1868 KB |
Output isn't correct |
17 |
Incorrect |
82 ms |
8160 KB |
Output isn't correct |
18 |
Incorrect |
92 ms |
8088 KB |
Output isn't correct |
19 |
Incorrect |
70 ms |
7580 KB |
Output isn't correct |
20 |
Incorrect |
66 ms |
7084 KB |
Output isn't correct |
21 |
Incorrect |
167 ms |
12360 KB |
Output isn't correct |
22 |
Incorrect |
158 ms |
11976 KB |
Output isn't correct |
23 |
Incorrect |
149 ms |
10080 KB |
Output isn't correct |
24 |
Incorrect |
179 ms |
12528 KB |
Output isn't correct |
25 |
Incorrect |
331 ms |
15940 KB |
Output isn't correct |
26 |
Correct |
193 ms |
13988 KB |
Output is correct |
27 |
Incorrect |
257 ms |
15956 KB |
Output isn't correct |
28 |
Incorrect |
294 ms |
15864 KB |
Output isn't correct |
29 |
Incorrect |
290 ms |
15976 KB |
Output isn't correct |
30 |
Incorrect |
279 ms |
15544 KB |
Output isn't correct |
31 |
Incorrect |
249 ms |
12796 KB |
Output isn't correct |
32 |
Incorrect |
262 ms |
15988 KB |
Output isn't correct |