Submission #64107367


Source Code Expand

#include <bits/stdc++.h>

using namespace std;
#define FAST_IO ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

typedef long long ll;

#define f first
#define s second

void solve(){
	FAST_IO
	ll n; cin >> n;
	vector<ll> a(n);

	unordered_map<ll,ll> freq;
	unordered_map<ll,ll> pos;

	for(ll i  = 0; i < n; i++){
		cin >> a[i];
		freq[a[i]]++;
		pos[a[i]] = i + 1;
	}

	ll max_value = -1, max_pos = -1;
	for(auto b : freq){
		if(b.s == 1 && b.f > max_value){
			max_value = b.f;
			max_pos = pos[max_value];
		}
	}

	cout << max_pos  << endl;


	
}

int main(){
	solve();
}

Submission Info

Submission Time
Task C - Uniqueness
User c_legg
Language C++ 20 (gcc 12.2)
Score 300
Code Size 631 Byte
Status AC
Exec Time 197 ms
Memory 29752 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 1 ms 3348 KiB
hand_02.txt AC 1 ms 3612 KiB
hand_03.txt AC 1 ms 3616 KiB
random_01.txt AC 197 ms 29752 KiB
random_02.txt AC 51 ms 14064 KiB
random_03.txt AC 184 ms 28792 KiB
random_04.txt AC 136 ms 23436 KiB
random_05.txt AC 188 ms 29412 KiB
random_06.txt AC 86 ms 14288 KiB
random_07.txt AC 49 ms 10652 KiB
random_08.txt AC 52 ms 11036 KiB
random_09.txt AC 20 ms 5528 KiB
random_10.txt AC 104 ms 17520 KiB
random_11.txt AC 105 ms 17496 KiB
random_12.txt AC 80 ms 17512 KiB
random_13.txt AC 84 ms 17484 KiB
random_14.txt AC 79 ms 17588 KiB
random_15.txt AC 75 ms 17560 KiB
random_16.txt AC 22 ms 8252 KiB
random_17.txt AC 4 ms 4404 KiB
random_18.txt AC 82 ms 15148 KiB
random_19.txt AC 56 ms 13152 KiB
random_20.txt AC 33 ms 9928 KiB
random_21.txt AC 2 ms 3580 KiB
random_22.txt AC 54 ms 13028 KiB
random_23.txt AC 18 ms 8000 KiB
sample_01.txt AC 1 ms 3420 KiB
sample_02.txt AC 1 ms 3448 KiB