Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.087 s | 13 KBi |
#2 |
Correcto
|
0.08 s | 13 KBi |
#3 |
Correcto
|
0.083 s | 10 KBi |
#4 |
Correcto
|
0.091 s | 13 KBi |
#5 |
Correcto
|
0.09 s | 13 KBi |
#6 |
Correcto
|
0.079 s | 13 KBi |
#7 |
Correcto
|
0.102 s | 13 KBi |
#8 |
Correcto
|
0.082 s | 13 KBi |
#9 |
Correcto
|
0.094 s | 10 KBi |
#10 |
Correcto
|
0.084 s | 13 KBi |
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(String ln; (ln = in.readLine())!= null;){ int N = Integer.parseInt(ln); StringTokenizer st = new StringTokenizer(in.readLine()); StringBuilder sb = new StringBuilder(); int[] values = new int[N]; for(int i=0; i<N; i++) values[i] = Integer.parseInt(st.nextToken()); int Q = Integer.parseInt(in.readLine()); while(Q-->0){ int q = Integer.parseInt(in.readLine()); int total = 0; for(int i=0; i<N;i++) if(q<values[i]) total++; sb.append(total).append("\n"); } System.out.print(new String(sb).trim()); } } }