Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.069 s | 27 KBi |
#2 |
Correcto
|
0.044 s | 14 KBi |
#3 |
Correcto
|
0.044 s | 14 KBi |
#4 |
Correcto
|
0.047 s | 14 KBi |
#5 |
Correcto
|
0.046 s | 14 KBi |
#6 |
Correcto
|
0.04 s | 14 KBi |
#7 |
Correcto
|
0.075 s | 10 KBi |
#8 |
Correcto
|
0.063 s | 10 KBi |
#9 |
Correcto
|
0.046 s | 14 KBi |
#10 |
Correcto
|
0.045 s | 14 KBi |
#11 |
Correcto
|
0.047 s | 14 KBi |
#12 |
Tiempo límite excedido
|
1.074 s | 26 KBi |
#13 |
Tiempo límite excedido
|
1.068 s | 30 KBi |
#14 |
Tiempo límite excedido
|
1.083 s | 32 KBi |
#15 |
Tiempo límite excedido
|
1.054 s | 27 KBi |
#16 |
Correcto
|
0.513 s | 51 KBi |
#17 |
Correcto
|
0.519 s | 54 KBi |
import java.io.*; import java.util.StringTokenizer; import java.util.*; class Main { public static void main(String[] args) throws IOException{ List<Integer> arr = new ArrayList<Integer>(); List<Integer> res = new ArrayList<Integer>(); BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; st = new StringTokenizer(br.readLine()); st = new StringTokenizer(br.readLine()); while(st.hasMoreTokens()){ arr.add(Integer.parseInt(st.nextToken())); } int clave=-1; st = new StringTokenizer(br.readLine()); int x = Integer.parseInt(st.nextToken()); while(x>0){ st = new StringTokenizer(br.readLine()); int valor = Integer.parseInt(st.nextToken()); for(int i=0;i<arr.size();i++){ if(arr.get(i)>valor){ clave=i; break; } } res.add(clave); clave=-1; x--; } for(int i=0;i<res.size();i++){ if(res.get(i)!=-1){ System.out.println(res.get(i)); }else{ System.out.println(arr.size()); } } } }