Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#2 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#3 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#4 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#5 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#6 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#7 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#8 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#9 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
||
#10 |
Error de compilación
Main.java:3: error: class MainTemplate is public, should be declared in a file named MainTemplate.java public class MainTemplate { ^ 1 error |
import java.util.Scanner; public class MainTemplate { public static void main(String[] args) { Scanner sn = new Scanner(System.in); int size = Integer.parseInt(sn.nextLine()); String[] arItems = sn.nextLine().split(" "); int c = Integer.parseInt(sn.nextLine()); Integer[] xEntries = new Integer[c]; for (int i = 0; i < c; i++) { int arItem = Integer.parseInt(sn.nextLine()); xEntries[i] = arItem; } Integer[] entries = new Integer[size]; for (int i = 0; i < size; i++) { int arItem = Integer.parseInt(arItems[i]); entries[i] = arItem; } int count = 0; for (int i = 0; i < c; i++) { for (int j = 0; j < size; j++) { if (xEntries[i] < entries[j]) { ++count; } } System.out.println(count); count = 0; } } }