Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#2 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#3 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#4 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#5 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#6 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#7 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#8 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#9 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#10 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#11 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#12 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#13 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
||
#14 |
Error de compilación
main.c:2:1: error: unknown type name 'import' import java.util.Scanner; ^ main.c:2:12: error: expected ';' after top level declarator import java.util.Scanner; ^ ; main.c:4:1: error: unknown type name 'public' public class Main { ^ main.c:4:13: error: expected ';' after top level declarator public class Main { ^ ; 4 errors generated. |
import java.util.Scanner; public class Main { public static Scanner leer = new Scanner(System.in); public static void main(String[] args) { //input dimensiones String dimensiones = leer.nextLine().trim(); int filas = Integer.parseInt(dimensiones); int[] ejemplo1 = new int[filas]; //input de datos String[] filaDada = leer.nextLine().trim().split(" "); int k = 0; for (int j = 0; j < filas; j++) { ejemplo1[j] = Integer.parseInt(filaDada[k]); k++; //System.out.println(ejemplo1[i][j]); } // String numc = leer.nextLine().trim(); int numConsultas=Integer.parseInt(numc); for (int i = 0; i < numConsultas; i++) { String[] cons = leer.nextLine().trim().split(" "); int comienzo=Integer.parseInt(cons[0]); int finaliza=Integer.parseInt(cons[1]); System.out.println(sumaSubarreglo(ejemplo1,filas,comienzo, finaliza)); } } public static int cantidadMayores(int[] matriz, int filas, int consulta) { int toret=0; for (int i = 0; i < filas; i++) { if (matriz[i]>consulta){ toret++; } } return toret; } public static int sumaSubarreglo(int[] matriz, int filas, int comienzo, int finaliza){ int toret=0; for (int i = comienzo; i < finaliza; i++) { toret+=matriz[i]; } return toret; } }