7472022-01-05 16:58:40seprbarKéséscpp11Wrong answer 0/50386ms35852 KiB
// Keses

#include <bits/stdc++.h>
using namespace std;

int main () {
	// Measure execution speed (1)
	clock_t start, end;
	
	int N;
	cin >> N;
	long T[N];
	set <long> heard;
	for (int i = 0; i < N; i ++) {
		cin >> T[i];
		heard.insert(T[i]);
	}
	
	// Measure execution speed (2)
	start = clock();
	
	for (int i = N-1; i >= 0; i --) {
		heard.erase(T[i]);
		if ((int) heard.size() == 0) {
			cout << i+1;
			break;
		}
	}	
	
	// Measure execution speed (3)
	end = clock();
	double time_taken = double (end - start);
	cout << "\n( " << time_taken << " / " << CLOCKS_PER_SEC << " = " << time_taken / CLOCKS_PER_SEC << " sec )\n";
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/02ms1816 KiB
2Wrong answer0/023ms3120 KiB
3Wrong answer0/52ms2028 KiB
4Wrong answer0/52ms2032 KiB
5Wrong answer0/586ms6000 KiB
6Wrong answer0/561ms6756 KiB
7Wrong answer0/4296ms19772 KiB
8Wrong answer0/4305ms20700 KiB
9Wrong answer0/4270ms19864 KiB
10Wrong answer0/4254ms19204 KiB
11Wrong answer0/4247ms19128 KiB
12Wrong answer0/2344ms21816 KiB
13Wrong answer0/2363ms32636 KiB
14Wrong answer0/1360ms34248 KiB
15Wrong answer0/1386ms35852 KiB
16Wrong answer0/1270ms34596 KiB
17Wrong answer0/1282ms32408 KiB
18Wrong answer0/1143ms26344 KiB
19Wrong answer0/1118ms27860 KiB