Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.133 s | 22 KBi |
#2 |
Incorrecto
|
0.352 s | 14 KBi |
#3 |
Incorrecto
|
0.242 s | 14 KBi |
#4 |
Incorrecto
|
0.144 s | 14 KBi |
#5 |
Incorrecto
|
0.151 s | 15 KBi |
#6 |
Incorrecto
|
0.144 s | 13 KBi |
#7 |
Incorrecto
|
0.152 s | 12 KBi |
#8 |
Incorrecto
|
0.287 s | 14 KBi |
#9 |
Incorrecto
|
0.172 s | 14 KBi |
#10 |
Incorrecto
|
0.298 s | 14 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tamano = sc.nextInt(); int cont1 = 0; int cont2 = 0; int cont3 = 0; int[] v = new int[tamano]; for (int i = 0; i < v.length; i++) { v[i] = sc.nextInt(); } for (int i = 0; i < v.length; i++) { if (v[i] > 0) { cont1++; } } System.out.println(cont1); for (int i = 0; i < v.length; i++) { if (v[i] > 1) { cont2++; } } System.out.println(cont2); for (int i = 0; i < v.length; i++) { if (v[i] > 4) { cont3++; } } System.out.println(cont3); } }