Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.093 s | 14 KBi |
#2 |
Correcto
|
0.096 s | 16 KBi |
#3 |
Correcto
|
0.083 s | 16 KBi |
#4 |
Correcto
|
0.078 s | 16 KBi |
#5 |
Correcto
|
0.084 s | 16 KBi |
#6 |
Correcto
|
0.08 s | 16 KBi |
#7 |
Correcto
|
0.077 s | 16 KBi |
#8 |
Correcto
|
0.094 s | 13 KBi |
#9 |
Correcto
|
0.095 s | 16 KBi |
#10 |
Correcto
|
0.099 s | 13 KBi |
#11 |
Correcto
|
0.09 s | 16 KBi |
#12 |
Correcto
|
0.148 s | 16 KBi |
#13 |
Correcto
|
0.135 s | 15 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.675 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.677 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.45 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.696 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.474 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.91 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.796 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]; } System.out.println(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) return Integer.toString(i+1); } return "Impossible"; } }