Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.083 s | 16 KBi |
#2 |
Correcto
|
0.082 s | 16 KBi |
#3 |
Correcto
|
0.096 s | 13 KBi |
#4 |
Correcto
|
0.083 s | 16 KBi |
#5 |
Correcto
|
0.08 s | 16 KBi |
#6 |
Correcto
|
0.072 s | 16 KBi |
#7 |
Correcto
|
0.094 s | 13 KBi |
#8 |
Correcto
|
0.082 s | 16 KBi |
#9 |
Correcto
|
0.085 s | 16 KBi |
#10 |
Correcto
|
0.085 s | 16 KBi |
#11 |
Correcto
|
0.079 s | 16 KBi |
#12 |
Correcto
|
0.108 s | 19 KBi |
#13 |
Correcto
|
0.111 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.711 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.735 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.635 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.637 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.701 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.836 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.717 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 [] m = new int [n]; for(int i =0; i<n; i++){ m[i]= sc.nextInt(); } System.out.println(splitArray(m)); } public static String splitArray(int [] array){ int leftSide=0; int rightSide=0; for(int i =0; i<array.length; i++){ rightSide+=array[i]; } 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"; } }