Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
294 B
0
Indexable
Never
#include <iostream> 
#include <algorithm>
using namespace std;

int main()
{
int y = 0;
cin >> y;
int s[9999] = {};

for (int i = 0; i < y; i++)
{
	cin >> s[i];
}

sort(s, s + 1);

for (int i = 0; i < y; i++)
{
	if (i+1 != s[i])
	{
		cout << s[i]-1;
		break;
	}
}


}
Leave a Comment