Submission #922233

#TimeUsernameProblemLanguageResultExecution timeMemory
922233WhisperHindeks (COCI17_hindeks)C++17
50 / 50
72 ms7752 KiB
#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 timeMemoryGrader output
Fetching results...