# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
922233 | Whisper | Hindeks (COCI17_hindeks) | C++17 | 72 ms | 7752 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define fora(i,a,b) for ( ll i = a ; i <= b ; i++ )
#define ptrongnopro cin.tie(nullptr)->ios_base::sync_with_stdio(0); cout.tie(0);
using namespace std;
typedef long long ll;
ll n;
ll dem=0;
vector<ll> v;
int main(){
ptrongnopro
cin >> n;
for ( ll i = 1 ; i <= n ; i++ ){
ll x; cin >> x; v.push_back(x);
}
sort( v.begin() , v.end() );
for ( ll i = n-1 ; i >= 0 ; i-- ){
if ( v[i] >= n-i ) dem++;
}
if ( dem == 0 ) cout << v[0];
else cout << dem;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |