Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.133 s | 13 KBi |
#2 |
Correcto
|
0.133 s | 13 KBi |
#3 |
Correcto
|
0.142 s | 13 KBi |
#4 |
Incorrecto
|
0.136 s | 13 KBi |
#5 |
Correcto
|
0.131 s | 13 KBi |
#6 |
Incorrecto
|
0.135 s | 13 KBi |
#7 |
Incorrecto
|
0.145 s | 13 KBi |
#8 |
Incorrecto
|
0.121 s | 13 KBi |
#9 |
Incorrecto
|
0.136 s | 13 KBi |
#10 |
Correcto
|
0.116 s | 13 KBi |
#11 |
Correcto
|
0.132 s | 13 KBi |
#12 |
Correcto
|
0.195 s | 15 KBi |
#13 |
Correcto
|
0.192 s | 16 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.97 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.923 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.9 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.985 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.952 s | 125 KBi |
#19 |
Tiempo límite excedido
|
1.021 s | 97 KBi |
#20 |
Tiempo límite excedido
|
1.048 s | 125 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int [] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } for (int p = 0; p < n; p++) { int left = 0, right = 0; for (int i = 0; i < p; i++) { left += a[i]; } for (int i = p; i < n; i++) { right += a[i]; } if (left > 0 && right < 0) { System.out.println(p); break; } } } }