|
|
вернуться в форумplease help me what Wrong answer in test 6 JAVA import java.util.Scanner; public class _1645 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int i, j; long n, min, max; n = s.nextInt(); long[] a = new long[(int) n]; for (i = 0; i < n; i++) { a[i] = s.nextInt(); } for (i = 0; i < n; i++) { min = 1; max = n; for (j = 0; j < n; j++) { if (j > i & (a[j] < a[i])) { min++; } if (j < i & (a[j] > a[i])) { max--; } } System.out.println(min + " " + max); } } } |
|
|