196962025-12-19 09:29:08tenyeszbikaKéséscpp17Time limit exceeded 21/50600ms1132 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>

using namespace std;

int t, n, mini = 200001, p;

vector <pair<int, int>> v;

bool cigany(pair<int, int> so)
{
	if (so.second == t)
		return true;
	else return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
		cin.tie(0);
		cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; ++i)
	{
		cin >> t;
		auto p = find_if(v.begin(), v.end(), cigany);
		if (p == v.end())
			v.push_back({ i,t });
		else
			(*p).first = i;
	}
	for (auto& i : v)
	{
		if (mini > i.first)
			mini = i.first;
	}
	cout << mini;

}



SubtaskSumTestVerdictTimeMemory
base21/50
1Accepted0/01ms316 KiB
2Accepted0/048ms564 KiB
3Accepted5/51ms500 KiB
4Accepted5/51ms508 KiB
5Accepted5/579ms440 KiB
6Accepted5/579ms316 KiB
7Time limit exceeded0/4600ms932 KiB
8Time limit exceeded0/4583ms948 KiB
9Time limit exceeded0/4588ms948 KiB
10Time limit exceeded0/4589ms924 KiB
11Time limit exceeded0/4586ms928 KiB
12Time limit exceeded0/2580ms1132 KiB
13Time limit exceeded0/2586ms956 KiB
14Time limit exceeded0/1587ms952 KiB
15Time limit exceeded0/1580ms948 KiB
16Time limit exceeded0/1580ms948 KiB
17Time limit exceeded0/1583ms952 KiB
18Time limit exceeded0/1583ms416 KiB
19Accepted1/1326ms316 KiB