38592023-03-03 12:20:34vááááKéséscsharpAccepted 50/50210ms74276 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace késés
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int max = int.MinValue;
            int[] be = new int[n];
            string a = Console.ReadLine();
            string[] b = a.Split();
            for (int i = 0; i < n; i++)
            {
                be[i] = int.Parse(b[i]);
                if (int.Parse(b[i]) > max) max = int.Parse(b[i]);
            }
            bool[] ev = new bool[max+1];
            int min = int.MaxValue;
            for (int i = n-1; i > -1; i--)
            {
                if (!ev[be[i]]) { 
                    ev[be[i]] = true;
                    min = i + 1;
                }
            }
            Console.WriteLine(min);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/027ms20296 KiB
2Accepted0/045ms24784 KiB
3Accepted5/532ms22208 KiB
4Accepted5/532ms22532 KiB
5Accepted5/5151ms53196 KiB
6Accepted5/5150ms53524 KiB
7Accepted4/4175ms58304 KiB
8Accepted4/4175ms58432 KiB
9Accepted4/4173ms58564 KiB
10Accepted4/4173ms58740 KiB
11Accepted4/4178ms58668 KiB
12Accepted2/2209ms72228 KiB
13Accepted2/2209ms73720 KiB
14Accepted1/1210ms73644 KiB
15Accepted1/1210ms73980 KiB
16Accepted1/1210ms74204 KiB
17Accepted1/1210ms74276 KiB
18Accepted1/1208ms72576 KiB
19Accepted1/1208ms72824 KiB