36352023-03-01 12:49:33BenedekKéséscsharpAccepted 50/50241ms87924 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[] szm = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Dictionary<int, long> k = new Dictionary<int, long>();
            int hely = 1; 
            for (int i = 0; i < N; i++)
            {
                if (!k.ContainsKey(szm[i]))
                {
                    k.Add(szm[i], 0);
                }
                k[szm[i]] = i;
            }
            var x = k.ToList();
            var y = x.Min(X => X.Value);
            Console.WriteLine(y + 1);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/035ms22380 KiB
2Accepted0/054ms28044 KiB
3Accepted5/541ms23684 KiB
4Accepted5/541ms23748 KiB
5Accepted5/5146ms54620 KiB
6Accepted5/5151ms54760 KiB
7Accepted4/4199ms79968 KiB
8Accepted4/4209ms80032 KiB
9Accepted4/4199ms78808 KiB
10Accepted4/4206ms78552 KiB
11Accepted4/4203ms77688 KiB
12Accepted2/2211ms74104 KiB
13Accepted2/2241ms87740 KiB
14Accepted1/1229ms87924 KiB
15Accepted1/1226ms87796 KiB
16Accepted1/1229ms75468 KiB
17Accepted1/1212ms75396 KiB
18Accepted1/1201ms75516 KiB
19Accepted1/1199ms74576 KiB