75552024-01-09 14:56:40PeterNegáló rendezés (55 pont)csharpAccepted 55/55111ms55276 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());
            var sorozat = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Dictionary<long, long> V = new Dictionary<long, long>();
            int min = 100001;
            foreach (var item in sorozat)
            {
                if (!V.ContainsKey(item))
                {
                    V.Add(item, 0);
                }
                V[item]++;
                if (item<min)
                {
                    min = item;
                }
            }
            long szorzat = 1;
            foreach (var item in V)
            {
                if (item.Key!=min)
                {
                    szorzat = (szorzat * (item.Value+1)) % 1000000007;
                }
            }
            

            Console.WriteLine(szorzat);
            Console.ReadKey();
          
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/035ms22664 KiB
2Accepted0/0111ms44412 KiB
3Accepted2/235ms23688 KiB
4Accepted2/235ms23984 KiB
5Accepted2/235ms24072 KiB
6Accepted2/235ms24168 KiB
7Accepted3/335ms24488 KiB
8Accepted2/235ms25168 KiB
9Accepted3/341ms26312 KiB
10Accepted3/3108ms52844 KiB
11Accepted3/3111ms55276 KiB
12Accepted3/3101ms40976 KiB
13Accepted3/3104ms41000 KiB
14Accepted3/3104ms45404 KiB
15Accepted3/3105ms41596 KiB
16Accepted3/3108ms48228 KiB
17Accepted3/3104ms47772 KiB
18Accepted3/3105ms44652 KiB
19Accepted3/3105ms46232 KiB
20Accepted3/3105ms45768 KiB
21Accepted3/398ms42820 KiB
22Accepted3/3101ms42196 KiB