36392023-03-01 13:04:10tothgergelyKéséscsharpAccepted 50/50241ms89724 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace keses
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] t = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Dictionary<int, long> d = new Dictionary<int, long>();
            int hely = 1;
            for (int i = 0; i < n; i++)
            {
                if (!d.ContainsKey(t[i]))
                {
                    d.Add(t[i], 0);
                }
                d[t[i]] = i;
            }var x = d.ToList();
            var y = x.Min(X => X.Value);
            Console.WriteLine(y + 1);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/035ms22604 KiB
2Accepted0/052ms28100 KiB
3Accepted5/541ms23920 KiB
4Accepted5/541ms23996 KiB
5Accepted5/5146ms55220 KiB
6Accepted5/5156ms55220 KiB
7Accepted4/4199ms80660 KiB
8Accepted4/4208ms80840 KiB
9Accepted4/4197ms80288 KiB
10Accepted4/4204ms80120 KiB
11Accepted4/4194ms80020 KiB
12Accepted2/2222ms76248 KiB
13Accepted2/2241ms89724 KiB
14Accepted1/1241ms89652 KiB
15Accepted1/1230ms89212 KiB
16Accepted1/1230ms77228 KiB
17Accepted1/1212ms78996 KiB
18Accepted1/1201ms76860 KiB
19Accepted1/1193ms75920 KiB