77132024-01-10 14:44:53CsongiKéséscpp17Forditási hiba
#include <iostream>
#include <bits/stdc++.h>
#include <unordered_set>

using namespace std;

int index(int v, const unordered_set<int> tomb)
{
	auto it = tomb.find(v);
	if (it != tomb.end())
	{
		return distance(tomb.begin(), it);
	}
}

int main()
{
    int n;
    cin >> n;
	unordered_set<int> szamok;
	vector<int> evek(n);
	for (int i = 0; i < n; i++)
	{
		int most;
		cin >> most;
		szamok.insert(most);
		evek[i] = most;
	}
	vector<int> talalat(szamok.size(), 0);
	//int ind = 0;
	for (int i = n-1; i >= 0; i--)
	{
		int asd = index(evek[i], szamok);
		if (talalat[asd] == 1)
			asd++;
		if (all_of(talalat.begin(), talalat.end(), 1))
		{
			cout << i;
			break;
		}
	}
}
Forditási hiba
exit status 1
In file included from /usr/include/c++/11/bits/stl_algobase.h:71,
                 from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/ostream:38,
                 from /usr/include/c++/11/iostream:39,
                 from main.cpp:1:
/usr/include/c++/11/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_negate<_Predicate>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Predicate = int]':
/usr/include/c++/11/bits/stl_algobase.h:2069:14:   required from '_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, std::random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Predicate = __gnu_cxx::__ops::_Iter_negate<int>]'
/usr/include/c++/11/bits/stl_algo.h:106:28:   required from '_InputIterator std::__find_if_not(_InputIterator, _InputIterator, _Predicate) [w...