Submission #86517

# Submission time Handle Problem Language Result Execution time Memory
86517 2018-11-26T11:52:03 Z Asag Hindeks (COCI17_hindeks) C++14
50 / 50
231 ms 4412 KB
#include <bits/stdc++.h>
using namespace std;
long long n , mn ,cnt,mx = 1e7,sum,a[500000 + 5];
int main()
{
	cin>>n;
	for(int i = 1; i <= n ;i ++)
	{
		cin>>a[i];
	}mn = n;
	sort(a + 1, a + n + 1);
	for(int i = 1; i <= n ;i ++)
	{
		cnt++;
		if(n - cnt >= a[i])
		{
			mn = n - cnt;
		}
	}
	cout<<mn;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 432 KB Output is correct
3 Correct 3 ms 440 KB Output is correct
4 Correct 2 ms 440 KB Output is correct
5 Correct 2 ms 508 KB Output is correct
6 Correct 3 ms 508 KB Output is correct
7 Correct 6 ms 512 KB Output is correct
8 Correct 48 ms 1280 KB Output is correct
9 Correct 231 ms 4412 KB Output is correct
10 Correct 124 ms 4412 KB Output is correct