Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.079 s | 16 KBi |
#2 |
Incorrecto
|
0.084 s | 16 KBi |
#3 |
Incorrecto
|
0.085 s | 16 KBi |
#4 |
Incorrecto
|
0.115 s | 13 KBi |
#5 |
Correcto
|
0.082 s | 16 KBi |
#6 |
Incorrecto
|
0.083 s | 16 KBi |
#7 |
Incorrecto
|
0.089 s | 16 KBi |
#8 |
Incorrecto
|
0.082 s | 16 KBi |
#9 |
Incorrecto
|
0.084 s | 16 KBi |
#10 |
Incorrecto
|
0.092 s | 13 KBi |
#11 |
Incorrecto
|
0.088 s | 16 KBi |
#12 |
Correcto
|
0.153 s | 15 KBi |
#13 |
Incorrecto
|
0.109 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.696 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.599 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.675 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.453 s | 125 KBi |
#18 |
Correcto
|
0.599 s | 120 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.787 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.808 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(); int s= 0; int [] m = new int [n]; for(int i =0; i<n; i++){ m[i]= sc.nextInt(); s+=m[i]; } splitArray(m,s); } public static String splitArray(int [] array, int s){ int leftSide=0; int rightSide=s; for(int i =0; i<array.length; i++){ leftSide+=array[i]; rightSide-=array[i]; if(leftSide>0 && rightSide<0) System.out.println(i+1); return ""; } System.out.println("Impossible"); return ""; } }