-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfix_you.cpp
More file actions
47 lines (43 loc) · 898 Bytes
/
fix_you.cpp
File metadata and controls
47 lines (43 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int t;
cin>>t;
for(long long int T=0;T<t;T++)
{
int n,m;
cin>>n>>m;
char arr[n][m];
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
cin>>arr[i][j];
}
}
long long int a=0;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(j==(m-1))
{
if(arr[i][j]=='R')
{
a++;
}
}
if(i==(n-1))
{
if(arr[i][j]=='D')
{
a++;
}
}
}
}
cout<<a<<"\n";
}
return 0;
}