a.题目链接
Problem - 1680B - Codeforceshttps://codeforces.com/problemset/problem/1680/Bb.题解
#include <bits/stdc++.h>
using namespace std;
int main()
{
int s[5][5];
int t;
for(cin >> t; t--;){
int r,l;
cin >> r >> l;
int y = r, x = l;
for(int i = 0; i<r; i++){
for(int j = 0; j<l; j++){
char ch;
cin >> ch;
if(ch == 'R'){
y = min(y, i);
x = min(x, j);
}
s[i][j] = ch;
}
}
if(s[y][x] == 'R')cout << "Yes" << endl;
else cout << "No" << endl;
}
}
//求最上角那个定点的坐标,通过y=min(y,i) 和 x = min(x,j);