█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 3885

Problema 0x62 - Contar elementos mayores a X en un arreglo pequeño

  • Autor: Jhon_z09
  • Fecha: 2021-04-20 19:52:04 UTC (Hace casi 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#2
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#3
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#4
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#5
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#6
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#7
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#8
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#9
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
#10
Error de compilación
                      main.c:1:10: fatal error: 'bits/stdc++.h' file not found
#include <bits/stdc++.h>
         ^~~~~~~~~~~~~~~
1 error generated.

                    
Puntos totales: 0 / 100

Código

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
   int n; cin >> n;
   vector<ll> arr(n);
   for(int i = 0; i < n; ++i) cin >> arr[i];

   int c; cin >> c;
   while(c--){
        ll k, Q = 0; cin >> k;
        for(ll i: arr) Q += ((i > k) ? 1: 0); 
        cout << Q << "\n";
   }
   return 0;
}