Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.103 s | 12 KBi |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.118 s | 12 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.107 s | 11 KBi |
#4 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.092 s | 12 KBi |
#5 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.107 s | 11 KBi |
#6 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.106 s | 12 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.083 s | 12 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.087 s | 11 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.097 s | 11 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.081 s | 12 KBi |
package com.company; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int c = sc.nextInt(); for(int j = 0;j<c;j++){ int N = sc.nextInt(); int []array = new int[N]; int []solve= new int[N]; for(int i = 0;i<N;i++) { array[i] = sc.nextInt(); } Queue<Integer> l = new LinkedList<>(); for(int i = N-1;i>=0;i--){ if(l.size() > 0 ){ while(!l.isEmpty() && array[i] >= l.peek()){ l.poll(); } if(l.size() == 0){ solve[i] = -1; l.offer(array[i]); }else{ solve[i] = l.peek(); l.offer(array[i]); } }else{ solve[i] = -1; l.offer(array[i]); } } System.out.print("Case #" + (j+1) + ":"); for(int i = 0;i<N;i++) System.out.print(" " + solve[i]); System.out.println(); } } }