Submission #64063555


Source Code Expand

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

int main()
{
    unordered_map<int,int> mp;
    int n; cin>>n;
    int arr[n];
    for(int i=0;i<n;i++) {
        cin>>arr[i]; mp[arr[i]]++;
    }
    int mx = -1, num = -1;
    for(int i=0;i<n;i++) {
        if(mp[arr[i]] == 1) {
            if(num < arr[i]) {
                mx = i+1;
                num = arr[i];
            }
        }
    }
    
    cout<<mx<<endl;
    
    
    

    return 0;
}

Submission Info

Submission Time
Task C - Uniqueness
User sivasaran2003
Language C++ 20 (gcc 12.2)
Score 300
Code Size 480 Byte
Status AC
Exec Time 124 ms
Memory 16520 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 3560 KiB
hand_02.txt AC 1 ms 3356 KiB
hand_03.txt AC 1 ms 3452 KiB
random_01.txt AC 124 ms 16520 KiB
random_02.txt AC 45 ms 8560 KiB
random_03.txt AC 118 ms 15976 KiB
random_04.txt AC 86 ms 13416 KiB
random_05.txt AC 122 ms 16188 KiB
random_06.txt AC 104 ms 9036 KiB
random_07.txt AC 76 ms 6908 KiB
random_08.txt AC 77 ms 7096 KiB
random_09.txt AC 76 ms 4728 KiB
random_10.txt AC 103 ms 10304 KiB
random_11.txt AC 102 ms 10288 KiB
random_12.txt AC 97 ms 10428 KiB
random_13.txt AC 98 ms 10220 KiB
random_14.txt AC 96 ms 10360 KiB
random_15.txt AC 97 ms 10320 KiB
random_16.txt AC 30 ms 5880 KiB
random_17.txt AC 6 ms 4024 KiB
random_18.txt AC 75 ms 9148 KiB
random_19.txt AC 57 ms 8476 KiB
random_20.txt AC 42 ms 6400 KiB
random_21.txt AC 2 ms 3560 KiB
random_22.txt AC 57 ms 8448 KiB
random_23.txt AC 25 ms 5860 KiB
sample_01.txt AC 1 ms 3436 KiB
sample_02.txt AC 1 ms 3460 KiB