Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.086 s | 16 KBi |
#2 |
Correcto
|
0.099 s | 13 KBi |
#3 |
Correcto
|
0.11 s | 29 KBi |
#4 |
Correcto
|
0.091 s | 13 KBi |
#5 |
Correcto
|
0.086 s | 13 KBi |
#6 |
Correcto
|
0.104 s | 21 KBi |
#7 |
Correcto
|
0.098 s | 13 KBi |
#8 |
Correcto
|
0.092 s | 13 KBi |
#9 |
Correcto
|
0.088 s | 13 KBi |
#10 |
Correcto
|
0.109 s | 27 KBi |
#11 |
Correcto
|
0.085 s | 13 KBi |
#12 |
Correcto
|
0.163 s | 24 KBi |
#13 |
Correcto
|
0.142 s | 19 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.748 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.617 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.622 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.663 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.652 s | 125 KBi |
#19 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.748 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.769 s | 125 KBi |
import java.util.*; public class Main { public static void main(String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); boolean achieved= false; int s= 0; int [] array = new int [n]; for(int i =0; i<n; i++){ array[i]= sc.nextInt(); s+=array[i]; } int leftSide=0; int rightSide=s; for(int i =0; i<n && achieved==false; i++){ leftSide+=array[i]; rightSide-=array[i]; if(leftSide>0 && rightSide<0){ System.out.println(i+1); achieved= true; } } if(achieved==false){ System.out.println("Impossible");} } }