75282024-01-09 13:28:30PeterNegáló rendezés (55 pont)csharpRuntime error 5/5593ms41676 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
    
namespace Negáló_rendezés
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] sorozat = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] tdb = new int[N + 1]; //tdb = tömb darabszám
            foreach (var item in sorozat)
            {
                tdb[item]++;
            }
            int min = 0;
            while (tdb[min]==0)
            {
                min++;
            }

            int szorzat = 1;
            for (int i = min+1; i <= N; i++)
            {
                if (tdb[i]!=0)
                {
                    szorzat *= tdb[i]+1;
                }
            }

            Console.WriteLine(szorzat);
            Console.ReadKey();
          
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base5/55
1Accepted0/032ms22196 KiB
2Runtime error0/089ms38616 KiB
3Accepted2/230ms23136 KiB
4Runtime error0/232ms22508 KiB
5Runtime error0/232ms22636 KiB
6Runtime error0/232ms22880 KiB
7Runtime error0/332ms22992 KiB
8Runtime error0/234ms23340 KiB
9Runtime error0/337ms24500 KiB
10Runtime error0/386ms38872 KiB
11Wrong answer0/390ms40756 KiB
12Accepted3/392ms40952 KiB
13Runtime error0/390ms40324 KiB
14Wrong answer0/393ms41132 KiB
15Runtime error0/390ms40612 KiB
16Wrong answer0/392ms40788 KiB
17Runtime error0/389ms39964 KiB
18Wrong answer0/393ms41676 KiB
19Wrong answer0/390ms41516 KiB
20Runtime error0/390ms41112 KiB
21Runtime error0/385ms40068 KiB
22Runtime error0/389ms40912 KiB