CCC '16 J1 - Tournament Selection
Source Code
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int counter = 0;
for(int i = 0; i < 6; i++){
if(in.next().equals("W")){
counter++;
}
}
if(counter == 0){
System.out.println("-1");
} else if(counter == 5 || counter == 6){
System.out.println("1");
}else if(counter == 3 || counter == 4){
System.out.println("2");
}else if(counter == 1 || counter == 2){
System.out.println("3");
}
}
}