Submission #86511

# Submission time Handle Problem Language Result Execution time Memory
86511 2018-11-26T11:48:59 Z Asag Hindeks (COCI17_hindeks) C++14
45 / 50
230 ms 4420 KB
#include <bits/stdc++.h>
using namespace std;
long long n , mn = 1,cnt,mx = 1e7,sum,a[500000 + 5];
int main()
{
	cin>>n;
	for(int i = 1; i <= n;i ++)
	{
		cin>>a[i];
	}
	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 2 ms 376 KB Output is correct
2 Correct 2 ms 480 KB Output is correct
3 Correct 2 ms 480 KB Output is correct
4 Correct 3 ms 480 KB Output is correct
5 Correct 2 ms 480 KB Output is correct
6 Correct 3 ms 500 KB Output is correct
7 Correct 6 ms 564 KB Output is correct
8 Correct 43 ms 1328 KB Output is correct
9 Correct 230 ms 4420 KB Output is correct
10 Incorrect 151 ms 4420 KB Output isn't correct