75342024-01-09 13:38:21PeterNegáló rendezés (55 pont)csharpRuntime error 8/5592ms42352 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 = (szorzat*(tdb[i]+1)%1000000007);
                    
                }
            }


            Console.WriteLine(szorzat);
            Console.ReadKey();
          
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base8/55
1Accepted0/032ms22508 KiB
2Runtime error0/089ms38548 KiB
3Accepted2/232ms23388 KiB
4Runtime error0/232ms22460 KiB
5Runtime error0/232ms22648 KiB
6Runtime error0/232ms23328 KiB
7Runtime error0/334ms23392 KiB
8Runtime error0/232ms23672 KiB
9Runtime error0/337ms24276 KiB
10Runtime error0/382ms39300 KiB
11Accepted3/390ms40820 KiB
12Accepted3/392ms40880 KiB
13Runtime error0/386ms40520 KiB
14Wrong answer0/390ms41380 KiB
15Runtime error0/386ms41032 KiB
16Wrong answer0/389ms41848 KiB
17Runtime error0/383ms40828 KiB
18Wrong answer0/389ms42352 KiB
19Wrong answer0/387ms41948 KiB
20Runtime error0/386ms41380 KiB
21Runtime error0/385ms41148 KiB
22Runtime error0/387ms41976 KiB