75422024-01-09 13:47:07PeterNegáló rendezés (55 pont)csharpRuntime error 20/5593ms42376 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++;
            }

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


            Console.WriteLine(szorzat);
            Console.ReadKey();
          
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base20/55
1Accepted0/032ms22528 KiB
2Runtime error0/086ms38684 KiB
3Accepted2/232ms23104 KiB
4Runtime error0/232ms22664 KiB
5Runtime error0/232ms23092 KiB
6Runtime error0/232ms23628 KiB
7Runtime error0/332ms23528 KiB
8Runtime error0/232ms23928 KiB
9Runtime error0/337ms24588 KiB
10Runtime error0/383ms39176 KiB
11Accepted3/393ms40772 KiB
12Accepted3/390ms41128 KiB
13Runtime error0/390ms40436 KiB
14Accepted3/393ms41564 KiB
15Runtime error0/390ms41000 KiB
16Accepted3/392ms41812 KiB
17Runtime error0/386ms40588 KiB
18Accepted3/393ms42376 KiB
19Accepted3/389ms41832 KiB
20Runtime error0/386ms41376 KiB
21Runtime error0/386ms40364 KiB
22Runtime error0/386ms41840 KiB