Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.073 s | 13 KBi |
#2 |
Correcto
|
0.077 s | 13 KBi |
#3 |
Correcto
|
0.077 s | 14 KBi |
#4 |
Correcto
|
0.076 s | 13 KBi |
#5 |
Correcto
|
0.1 s | 11 KBi |
#6 |
Correcto
|
0.103 s | 14 KBi |
#7 |
Correcto
|
0.101 s | 14 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.347 s | 125 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.501 s | 125 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.485 s | 125 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.467 s | 125 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.47 s | 125 KBi |
#13 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.437 s | 125 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.45 s | 125 KBi |
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(String ln; (ln = in.readLine())!= null;){ int N = Integer.parseInt(ln); StringTokenizer st = new StringTokenizer(in.readLine()); StringBuilder sb = new StringBuilder(); int[] values = new int[N]; for(int i=0; i<N; i++) values[i] = Integer.parseInt(st.nextToken()); int[][] res = new int[N][N]; for( int i =0; i<N; i++){ for(int j=i; j<N; j++){ for(int k = i; k<=j;k++){ res[i][j]+= values[k]; } } } int Q = Integer.parseInt(in.readLine()); while(Q-->0){ st = new StringTokenizer(in.readLine()); int p = Integer.parseInt(st.nextToken()); int q = Integer.parseInt(st.nextToken()); sb.append(res[p][q]).append("\n"); } System.out.print(new String(sb).trim()); } } }