fork(8) download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5. private Scanner scanner;
  6.  
  7. private Main(Scanner scanner) {
  8. this.scanner = scanner;
  9. }
  10.  
  11. public static void main(String[] args) {
  12. Main main = new Main(new Scanner(System.in));
  13. main.solve();
  14. }
  15.  
  16. private void solve() {
  17. int n = scanner.nextInt();
  18. int[] a = new int[n];
  19. for (int i = 0; i < n; i++) a[i] = scanner.nextInt();
  20. for (int i = 0; i < n; i++) {
  21. int s = 1;
  22. for (int j = 0; j < n; j++) if (a[j] > a[i]) s++;
  23. System.out.print(s);
  24. if (i < n - 1) System.out.print(" ");
  25. else
  26. System.out.println();
  27. }
  28. }
  29. }
Runtime error #stdin #stdout #stderr 0.14s 321088KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at Main.solve(Main.java:17)
	at Main.main(Main.java:13)