Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.122 s | 11 KBi |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.121 s | 12 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.118 s | 12 KBi |
#4 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.112 s | 12 KBi |
#5 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.092 s | 10 KBi |
#6 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.116 s | 12 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.095 s | 11 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.094 s | 11 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.122 s | 12 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.08 s | 12 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.105 s | 12 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.108 s | 12 KBi |
#13 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.123 s | 12 KBi |
#14 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main) |
0.099 s | 10 KBi |
package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int []array = new int[N]; int []sums = new int[N]; int sum = 0; for(int i = 0;i<N;i++){ array[i] = sc.nextInt(); sum += array[i]; sums[i] = sum; } int c = sc.nextInt(); for(int i = 0;i<c;i++){ int p = sc.nextInt(); int q = sc.nextInt(); int result = sums[q]-sums[p]+array[p]; System.out.println(result); } } }