← Back to List

16466번: 콘서트 ↗

Solutions

C++14
282 B | 282 chars
#include <iostream>
#include <algorithm>
using namespace std;
long long int N,ar[1100000],A;
int main()
{
	cin>>N;
	for(int x=0; x<N; x++)
	{
		cin>>ar[x];
	}
	sort(ar,ar+N);
	A=1;
	for(int x=0; x<N; x++)
	{
		if(ar[x]!=A)
		{
			cout<<A;
			return 0;
		}
		else A++;
	}
	cout<<A;
}