|
|
вернуться в форумWhy WA? import java.util.Arrays; import java.util.Scanner; public class Example2 { private static int[] col; private static int count = 1; private static int superCount = 0; public static void main(String[] args) { try { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); if (a>=0 && a<=150){ col = new int[a]; for (int i = 0; i < a; i++) { col[i]=scanner.nextInt(); if(col[i]<600 || col[i]>700){ //System.out.print("0"); throw new Exception(); } } Arrays.sort(col); for (int i = 1; i < col.length; i++) { if (col[i]==col[i-1]) { count ++; if (count==4) { superCount ++; count=1; } }else count=1; } System.out.print(superCount); }else if (a>=0){System.out.print("0");} } catch (Exception e) {} } } |
|
|