fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. char ch[8][8];
  10. int c = 0;
  11. for(int i=0;i<8;i++)
  12. {
  13. for(int j=0;j<8;j++)
  14. {
  15. cin >> ch[i][j];
  16. if(ch[i][j]=='R')
  17. {
  18. c++;
  19. }
  20. if(c==8)
  21. break;
  22. }
  23. cout << c << endl;
  24. c = 0;
  25. }
  26. if(c==8)
  27. cout << "R" << endl;
  28. else
  29. cout << "B" << endl;
  30. }
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5288KB
stdin
4


....B...
....B...
....B...
RRRRRRRR
....B...
....B...
....B...
....B...


RRRRRRRB
B......B
B......B
B......B
B......B
B......B
B......B
RRRRRRRB


RRRRRRBB
.B.B..BB
RRRRRRBB
.B.B..BB
.B.B..BB
RRRRRRBB
.B.B..BB
.B.B..BB


........
........
........
RRRRRRRR
........
........
........
........
stdout
0
0
0
8
0
0
0
0
B
7
0
0
0
0
0
0
7
B
6
0
6
0
0
6
0
0
B
0
0
0
8
0
0
0
0
B