77692024-01-11 09:24:37TortelliniJrNegáló rendezés (55 pont)csharpAccepted 55/55118ms54712 KiB
using System;
using System.Collections.Generic;
using System.Linq;



namespace negalorendezes
{
    class Program
    {
        static void Main(string[] args)
        {
            int db = int.Parse(Console.ReadLine());
            Dictionary<long, long> n = new Dictionary<long, long>();
            long min = 100001;
            long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
            for (int i = 0; i < db; i++)
            {
                if (!n.ContainsKey(a[i]))
                {
                    n.Add(a[i], 0);
                }
                n[a[i]]++;
                min = Math.Min(min, a[i]);
            }
            long sol = 1;
            foreach (var item in n)
            {
                if (item.Key != min)
                {
                    sol = sol * (item.Value + 1) % 1000000007;
                }
            }
            Console.WriteLine(sol);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/035ms22540 KiB
2Accepted0/0109ms45120 KiB
3Accepted2/235ms23140 KiB
4Accepted2/235ms23320 KiB
5Accepted2/235ms23648 KiB
6Accepted2/235ms24140 KiB
7Accepted3/335ms24556 KiB
8Accepted2/235ms24632 KiB
9Accepted3/341ms25448 KiB
10Accepted3/3111ms52740 KiB
11Accepted3/3118ms54712 KiB
12Accepted3/397ms41124 KiB
13Accepted3/3103ms41128 KiB
14Accepted3/3107ms45712 KiB
15Accepted3/3103ms42352 KiB
16Accepted3/3111ms48344 KiB
17Accepted3/3109ms48316 KiB
18Accepted3/3108ms44764 KiB
19Accepted3/3108ms46372 KiB
20Accepted3/3104ms46484 KiB
21Accepted3/398ms43404 KiB
22Accepted3/3101ms42992 KiB