# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
866382 | Tejas_Mondeeri | Hindeks (COCI17_hindeks) | C++14 | 149 ms | 5716 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.
// Hindeks
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
void fn()
{
// fstream myfile;
// myfile.open("inp.txt", ios::in);
int n;
cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; i++)
cin >> nums[i];
sort(nums.begin(), nums.end(), greater<int>());
int sol = 0;
for (int i = 0; i < n; i++)
{
if (nums[i] > i)
sol = i + 1;
else
break;
}
cout << sol << endl;
}
int main()
{
int t = 1;
// cin>>t;
while (t--)
fn();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |