Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#2 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#3 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#4 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#5 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#6 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#7 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#8 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#9 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#10 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#11 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#12 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#13 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
||
#14 |
Error de compilación
Main.java:6: error: ';' expected int n = scan.nextInt() ^ Main.java:20: error: ';' expected x+=arr[j] ^ 2 errors |
import java.util.Scanner; class Main{ public static void main(String [] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt() int[] arr = new int[n]; for(int i:arr){ arr[i] = scan.nextInt(); } int c = scan.nextInt(); for(int i=0; i<c; i++){ int a = scan.nextInt(); int b = scan.nextInt(); int x =0; for(int j=a;j<=b;j++){ x+=arr[j] } System.out.println(x); } } }