191972025-11-28 16:17:46Teret222Aranycipők (45)csharpRuntime error 0/4514ms3012 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace cipok
{
    class Program
    {
        static void Main(string[] args)
        {

            int szam = int.Parse(Console.ReadLine());

            int legtobb = 0;
            int nyertesszam = 0;
            List<int> nyertesek = new List<int>();

            int akt = -1;

            for (int i = 0; i < szam; i++)
            {
                akt = int.Parse(Console.ReadLine());

                if (akt == legtobb)
                {
                    nyertesek.Add(i + 1);
                    nyertesszam++;
                }
                else if (akt > legtobb)
                {
                    legtobb = akt;
                    nyertesek.Clear();

                    nyertesek.Add(i + 1);
                    nyertesszam = 1;

                }
            }

            Console.WriteLine(legtobb);
            Console.WriteLine(nyertesszam);
            foreach (var item in nyertesek)
            {
                Console.WriteLine(item);
            }

            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/45
1Runtime error0/014ms2796 KiB
2Runtime error0/014ms2828 KiB
3Runtime error0/314ms2740 KiB
4Runtime error0/314ms3012 KiB
5Runtime error0/314ms2576 KiB
6Runtime error0/314ms3004 KiB
7Runtime error0/314ms2852 KiB
8Runtime error0/314ms2784 KiB
9Runtime error0/314ms2776 KiB
10Runtime error0/314ms2820 KiB
11Runtime error0/314ms2776 KiB
12Runtime error0/314ms2768 KiB
13Runtime error0/314ms2808 KiB
14Runtime error0/314ms2772 KiB
15Runtime error0/314ms2792 KiB
16Runtime error0/314ms2780 KiB
17Runtime error0/314ms2840 KiB