75352024-01-09 13:38:57PeterNegáló rendezés (55 pont)csharpRuntime error 20/5594ms43684 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++;
            }

            long 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
base20/55
1Accepted0/032ms22264 KiB
2Runtime error0/089ms38720 KiB
3Accepted2/230ms22836 KiB
4Runtime error0/232ms22308 KiB
5Runtime error0/232ms22192 KiB
6Runtime error0/234ms22948 KiB
7Runtime error0/334ms22992 KiB
8Runtime error0/234ms23160 KiB
9Runtime error0/335ms24260 KiB
10Runtime error0/386ms38872 KiB
11Accepted3/390ms40908 KiB
12Accepted3/392ms41160 KiB
13Runtime error0/387ms40620 KiB
14Accepted3/390ms41652 KiB
15Runtime error0/390ms41796 KiB
16Accepted3/394ms41992 KiB
17Runtime error0/385ms41432 KiB
18Accepted3/390ms43684 KiB
19Accepted3/393ms42556 KiB
20Runtime error0/390ms42156 KiB
21Runtime error0/386ms41448 KiB
22Runtime error0/390ms42512 KiB