Submission #86447

# Submission time Handle Problem Language Result Execution time Memory
86447 2018-11-26T10:26:27 Z Asag Hindeks (COCI17_hindeks) C++14
10 / 50
602 ms 18216 KB
#include <bits/stdc++.h>
using namespace std;
int n , mn = 1e9,sum,b[500000 + 5],cnt[500000 + 5];set <int> s;set <int>::iterator it;
int main()
{
	cin>>n;
	for(int i = 1; i <= n;i ++)
	{
		int l;
		cin>>l;
		cnt[l]++;
		mn = min(mn,l);
		s.insert(l);
	}
	for(it = s.begin();it != s.end() ;it  ++)
	{
		sum+=cnt[*it];
		if(n - sum > *it)
		{
			cout<<n - sum;
			return 0;
		}
	}
	cout<<mn;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 476 KB Output isn't correct
3 Incorrect 2 ms 476 KB Output isn't correct
4 Incorrect 2 ms 476 KB Output isn't correct
5 Incorrect 2 ms 476 KB Output isn't correct
6 Incorrect 3 ms 512 KB Output isn't correct
7 Incorrect 7 ms 768 KB Output isn't correct
8 Incorrect 76 ms 3980 KB Output isn't correct
9 Incorrect 602 ms 18216 KB Output isn't correct
10 Correct 166 ms 18216 KB Output is correct