Submission #64037368


Source Code Expand

#include<bits/stdc++.h>
//#include <atcoder/all>

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
//using namespace atcoder;

typedef long long ll;
typedef unsigned long long ull;

#define rep(i,N) for(int i=0;i<(N);++i)
#define rrep(i,N) for(int i=(N)-1;i>=0;--i)
#define all(A) A.begin(),A.end()

using vvi = vector<vector<int>>;
using P = pair<int,int>;

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T=bool> void YesNo(T flg){ cout << (flg? "Yes\n" : "No\n"); }

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    map<int,int> mp,ans;
    int N;cin >> N;
    rep(i,N){
        int A;cin >> A;
        mp[A]++;
        chmax(ans[A],i+1);
    }
    int val=-1;
    for(const auto& [A,cnt] : mp){
        if(cnt>1) continue;
        val=ans[A];
    }
    cout << val << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Uniqueness
User Isshii
Language C++ 23 (gcc 12.2)
Score 300
Code Size 1150 Byte
Status AC
Exec Time 438 ms
Memory 31524 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 3472 KiB
hand_02.txt AC 1 ms 3356 KiB
hand_03.txt AC 1 ms 3352 KiB
random_01.txt AC 438 ms 31524 KiB
random_02.txt AC 136 ms 14592 KiB
random_03.txt AC 419 ms 30600 KiB
random_04.txt AC 285 ms 23524 KiB
random_05.txt AC 431 ms 31244 KiB
random_06.txt AC 241 ms 12872 KiB
random_07.txt AC 160 ms 10388 KiB
random_08.txt AC 165 ms 10556 KiB
random_09.txt AC 17 ms 3492 KiB
random_10.txt AC 102 ms 17488 KiB
random_11.txt AC 102 ms 17456 KiB
random_12.txt AC 104 ms 17452 KiB
random_13.txt AC 104 ms 17540 KiB
random_14.txt AC 116 ms 17564 KiB
random_15.txt AC 116 ms 17416 KiB
random_16.txt AC 58 ms 8428 KiB
random_17.txt AC 7 ms 4396 KiB
random_18.txt AC 195 ms 15368 KiB
random_19.txt AC 144 ms 12644 KiB
random_20.txt AC 95 ms 10304 KiB
random_21.txt AC 2 ms 3644 KiB
random_22.txt AC 144 ms 12720 KiB
random_23.txt AC 44 ms 7544 KiB
sample_01.txt AC 1 ms 3496 KiB
sample_02.txt AC 1 ms 3480 KiB