Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.087 s | 16 KBi |
#2 |
Correcto
|
0.091 s | 16 KBi |
#3 |
Correcto
|
0.101 s | 17 KBi |
#4 |
Correcto
|
0.081 s | 16 KBi |
#5 |
Correcto
|
0.091 s | 16 KBi |
#6 |
Correcto
|
0.114 s | 17 KBi |
#7 |
Correcto
|
0.082 s | 16 KBi |
#8 |
Correcto
|
0.087 s | 16 KBi |
#9 |
Correcto
|
0.089 s | 16 KBi |
#10 |
Correcto
|
0.091 s | 16 KBi |
#11 |
Correcto
|
0.097 s | 17 KBi |
#12 |
Correcto
|
0.119 s | 17 KBi |
#13 |
Correcto
|
0.121 s | 18 KBi |
#14 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.49 s | 125 KBi |
#15 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.494 s | 125 KBi |
#16 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.527 s | 125 KBi |
#17 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.435 s | 125 KBi |
#18 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.499 s | 125 KBi |
#19 |
Correcto
|
0.883 s | 125 KBi |
#20 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.553 s | 125 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int totalCount = 0; int[] array = new int[n]; for(int i=0; i<n; i++){ array[i] = scanner.nextInt(); totalCount+=array[i]; } int left = 0; for(int i=0; i<=n; i++){ if(i==n){ System.out.println("Impossible"); break; } left += array[i]; int right = totalCount - left; if(left > 0 && right < 0){ System.out.println(i+1); break; } } } }