You are viewing a single comment's thread. Return to all comments →
Here is the solution in java
static int[] acmTeam(String[] topic) { int attendence=topic.length; int prevCount=0; int maxSuccess=0; ArrayList<Integer> al=new ArrayList<Integer>(); for(int i=0;i<attendence-1;i++){ for(int j=i+1;j<attendence;j++){ int count=0; for(int k=0;k<topic[i].length();k++){ if((topic[i].charAt(k)!='0')||(topic[j].charAt(k)!='0')){ count++; } } if(prevCount<count){ prevCount=count; } al.add(count); } } System.out.println(al); for(int n:al){ if(n==prevCount){ maxSuccess++; } } int[] result=new int[2]; result[0]=prevCount; result[1]=maxSuccess; return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
Here is the solution in java