Language: C++

#include <iostream>
#include <vector>
using namespace std;

long long n, k, u = 0, t;
long long a[200000];
vector<long long> s;

int main()
{
	cin >> n >> k;

	for (long long i = 0; i < n; i++)
		cin >> a[i];

	do{
		u++;
		for (long long j = 0; j < n; j++) {
			if (find(s.begin(), s.end(), a[j]) == s.end())
				s.push_back(a[j]);
			else {
				while (s.back() != a[j])
					s.pop_back();

				s.pop_back();
			}
		}
	} while (!s.empty());

	t = k % u;

	for (int i = 0; i < t; i++) {
		for (long long j = 0; j < n; j++) {
			if (find(s.begin(), s.end(), a[j]) == s.end())
				s.push_back(a[j]);
			else {
				while (s.back() != a[j])
					s.pop_back();

				s.pop_back();
			}
		}
	}
	
	if (s.size() > 0) {
		for (int i = 0; i < s.size() - 1; i++)
			cout << s[i] << " ";

		cout << s.back() << endl;
	}
	else
		cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)'
   19 |                         if (find(s.begin(), s.end(), a[j]) == s.end())
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:19:33: note:   '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   19 |                         if (find(s.begin(), s.end(), a[j]) == s.end())
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:34:33: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)'
   34 |                         if (find(s.begin(), s.end(), a[j]) == s.end())
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:34:33: note:   '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   34 |                         if (find(s.begin(), s.end(), a[j]) == s.end())
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~