Submission #153838

#TimeUsernameProblemLanguageResultExecution timeMemory
153838mirceaishereHindeks (COCI17_hindeks)C++14
45 / 50
293 ms5752 KiB
#include <iostream> using namespace std; int n, i, x, f[500002], v[500002]; int main(){ cin>>n; for(i=1; i<=n; i++){ cin>>x; if(x>n){ x=n; } f[x]++; } for(i=n; i>=1; i--){ f[i]+=f[i+1]; if(f[i]>=i){ cout<<i; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...