-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1680B.cpp
42 lines (39 loc) · 940 Bytes
/
1680B.cpp
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
#include <iostream>
#include <string>
int main()
{
int t;
std::cin>>t;
for(int j = 0; j < t; j++){
int n;
int m;
std::cin>>n>>m;
bool find = false;
bool flag = true;
int left_stolb = -1;
for (int i = 0; i < n; i++){
std::string str;
std::cin>>str;
for (int k = 0; k < str.size(); k++){
if (str[k] == 'R')
{
if (find){
if (k < left_stolb){
flag = false;
}
}
else{
find = true;
left_stolb = k;
}
}
}
}
if(flag){
std::cout<<"YES"<<std::endl;
}
else{
std::cout<<"NO"<<std::endl;
}
}
}