75452024-01-09 13:56:15PeterNegáló rendezés (55 pont)csharpRuntime error 0/5592ms41632 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[100001]; //tdb = tömb darabszám
            foreach (var item in sorozat)
            {
                tdb[item]++;
            }
            int min = 0;
            while (tdb[min]==0)
            {
                min++;
            }

            ulong szorzat = 1;
            for (int i = min+1; i <= 100001; i++)
            {
                if (tdb[i]>=0)
                {
                    szorzat = ((ulong)szorzat*((ulong)tdb[i]+1)%1000000007);
                    
                }
            }


            Console.WriteLine(szorzat);
            Console.ReadKey();
          
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/55
1Runtime error0/035ms22292 KiB
2Runtime error0/087ms38504 KiB
3Runtime error0/234ms22700 KiB
4Runtime error0/234ms22976 KiB
5Runtime error0/234ms23284 KiB
6Runtime error0/234ms23248 KiB
7Runtime error0/334ms23104 KiB
8Runtime error0/235ms23184 KiB
9Runtime error0/337ms23744 KiB
10Runtime error0/383ms37968 KiB
11Runtime error0/389ms39984 KiB
12Runtime error0/387ms40216 KiB
13Runtime error0/389ms39788 KiB
14Runtime error0/389ms40136 KiB
15Runtime error0/389ms40460 KiB
16Runtime error0/390ms40920 KiB
17Runtime error0/386ms40356 KiB
18Runtime error0/390ms41632 KiB
19Runtime error0/389ms40864 KiB
20Runtime error0/389ms40308 KiB
21Runtime error0/383ms39468 KiB
22Runtime error0/392ms41380 KiB