Submission #64055138


Source Code Expand

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    unordered_map<int, int> count;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        count[a[i]]++;
    }
    int max_val = -1;
    int label = -1;
    for (int i = 0; i < n; i++) {
        if (count[a[i]] == 1 && a[i] > max_val) {
            max_val = a[i];
            label = i + 1;
        }
    }
    cout << label << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Uniqueness
User yyyyt
Language C++ 20 (gcc 12.2)
Score 300
Code Size 487 Byte
Status AC
Exec Time 123 ms
Memory 16456 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 3372 KiB
hand_02.txt AC 1 ms 3492 KiB
hand_03.txt AC 1 ms 3444 KiB
random_01.txt AC 123 ms 16456 KiB
random_02.txt AC 48 ms 8608 KiB
random_03.txt AC 120 ms 15944 KiB
random_04.txt AC 88 ms 13324 KiB
random_05.txt AC 120 ms 16200 KiB
random_06.txt AC 107 ms 9052 KiB
random_07.txt AC 77 ms 6820 KiB
random_08.txt AC 80 ms 7228 KiB
random_09.txt AC 76 ms 4176 KiB
random_10.txt AC 108 ms 10220 KiB
random_11.txt AC 104 ms 10216 KiB
random_12.txt AC 99 ms 10236 KiB
random_13.txt AC 99 ms 10288 KiB
random_14.txt AC 100 ms 10452 KiB
random_15.txt AC 100 ms 10456 KiB
random_16.txt AC 32 ms 5804 KiB
random_17.txt AC 6 ms 3924 KiB
random_18.txt AC 76 ms 9232 KiB
random_19.txt AC 59 ms 8428 KiB
random_20.txt AC 42 ms 6552 KiB
random_21.txt AC 2 ms 3604 KiB
random_22.txt AC 59 ms 8476 KiB
random_23.txt AC 25 ms 5896 KiB
sample_01.txt AC 1 ms 3500 KiB
sample_02.txt AC 1 ms 3460 KiB