Skip to content

Instantly share code, notes, and snippets.

@qjatn0120
Created October 13, 2022 17:01
Show Gist options
  • Save qjatn0120/d75b95f1011c81540bfb506caf9b2841 to your computer and use it in GitHub Desktop.
Save qjatn0120/d75b95f1011c81540bfb506caf9b2841 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int t;
string s[8];
int main(){
cin.tie(nullptr), ios::sync_with_stdio(false);
cin >> t;
while(t--){
for(int i = 0; i < 8; i++) cin >> s[i];
bool ans = false;
for(int r = 0; r < 8; r++){
bool flag = true;
for(int c = 0; c < 8; c++){
if(s[r][c] != 'R') flag = false;
}
if(flag) ans = true;
}
cout << (ans ? "R\n" : "B\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment