Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.144 s | 13 KBi |
#2 |
Incorrecto
|
0.263 s | 13 KBi |
#3 |
Incorrecto
|
0.142 s | 14 KBi |
#4 |
Incorrecto
|
0.285 s | 14 KBi |
#5 |
Incorrecto
|
0.153 s | 13 KBi |
#6 |
Incorrecto
|
0.155 s | 14 KBi |
#7 |
Incorrecto
|
0.26 s | 14 KBi |
#8 |
Incorrecto
|
0.158 s | 12 KBi |
#9 |
Incorrecto
|
0.151 s | 14 KBi |
#10 |
Incorrecto
|
0.165 s | 12 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); } }