Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.072 s | 51 KBi |
#2 |
Correcto
|
0.05 s | 13 KBi |
#3 |
Correcto
|
0.049 s | 14 KBi |
#4 |
Correcto
|
0.039 s | 14 KBi |
#5 |
Correcto
|
0.043 s | 14 KBi |
#6 |
Correcto
|
0.053 s | 14 KBi |
#7 |
Correcto
|
0.057 s | 14 KBi |
#8 |
Correcto
|
0.075 s | 10 KBi |
#9 |
Correcto
|
0.049 s | 14 KBi |
#10 |
Correcto
|
0.047 s | 14 KBi |
import java.io.*; import java.util.StringTokenizer; import java.util.*; class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; st = new StringTokenizer(br.readLine()); st = new StringTokenizer(br.readLine()); List<Long> arr = new ArrayList<Long>(); List<Long> res = new ArrayList<Long>(); while(st.hasMoreTokens()){ arr.add(Long.parseLong(st.nextToken())); } st = new StringTokenizer(br.readLine()); int consultas = Integer.parseInt(st.nextToken()); for(int i=0;i<consultas;i++){ st = new StringTokenizer(br.readLine()); long dato = Long.parseLong(st.nextToken()); int contador = 0; for(int j=0;j<arr.size();j++){ if(arr.get(j)>dato){ contador++; } } res.add((long)contador); } for(int x=0;x<res.size();x++){ System.out.println(res.get(x)); } } }