Submission #86450

# Submission time Handle Problem Language Result Execution time Memory
86450 2018-11-26T10:30:44 Z Asag Hindeks (COCI17_hindeks) C++14
10 / 50
187 ms 4000 KB
#include <bits/stdc++.h>
using namespace std;
int n , mn = 1e9,sum,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 256 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 2 ms 508 KB Output isn't correct
4 Incorrect 2 ms 508 KB Output isn't correct
5 Incorrect 7 ms 508 KB Output isn't correct
6 Incorrect 2 ms 544 KB Output isn't correct
7 Incorrect 8 ms 800 KB Output isn't correct
8 Incorrect 86 ms 4000 KB Output isn't correct
9 Runtime error 3 ms 4000 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Correct 187 ms 4000 KB Output is correct