30802023-02-14 12:38:32tamasmarkKéséscpp17Accepted 50/50138ms26192 KiB
// keses.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <map>
#include <climits>

using namespace std;

struct adat
{
   unsigned long long db, pillanat;
};

unsigned long long n, i, mini,maxi,keses,a;
map<long long, long long> x;
vector<adat>y;

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    //y.resize(999999);
    for (i = 1; i <= n; ++i)
    {
        cin >> a;
        //if(x[a]>0) 
        x[a] = i;
        
    }
    keses = n;
    for (auto e : x)
    {
        if (e.second < keses) keses = e.second;
    }
    cout << keses;
    return 0;
}
/*
6
1848 1849 1848 1849 895 1516
*/
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1888 KiB
2Accepted0/08ms3308 KiB
3Accepted5/53ms2512 KiB
4Accepted5/53ms2456 KiB
5Accepted5/537ms2764 KiB
6Accepted5/537ms2928 KiB
7Accepted4/4112ms18800 KiB
8Accepted4/4109ms18364 KiB
9Accepted4/4101ms16220 KiB
10Accepted4/497ms14832 KiB
11Accepted4/494ms13348 KiB
12Accepted2/2104ms14536 KiB
13Accepted2/2134ms26192 KiB
14Accepted1/1138ms26000 KiB
15Accepted1/1138ms25688 KiB
16Accepted1/1122ms21472 KiB
17Accepted1/1107ms16196 KiB
18Accepted1/165ms5440 KiB
19Accepted1/159ms4864 KiB