77712024-01-11 09:27:16NotYouNegáló rendezés (55 pont)csharpAccepted 55/55118ms55976 KiB
using System;
using System.Collections.Generic;
using System.Linq;



namespace negalorendezes
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Dictionary<long, long> m = new Dictionary<long, long>();
            long lk = 100001;
            long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
            for (int i = 0; i < n; i++)
            {
                if (!m.ContainsKey(a[i]))
                {
                    m.Add(a[i], 0);
                }
                m[a[i]]++;
                lk = Math.Min(lk, a[i]);
            }
            long db = 1;

            foreach (var item in m)
            {
                if (item.Key != lk)
                {
                    db = db * (item.Value + 1) % 1000000007;
                }
            }

            Console.WriteLine(db);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/035ms22588 KiB
2Accepted0/0108ms45496 KiB
3Accepted2/234ms23260 KiB
4Accepted2/235ms23684 KiB
5Accepted2/235ms24184 KiB
6Accepted2/235ms23960 KiB
7Accepted3/335ms24468 KiB
8Accepted2/235ms25044 KiB
9Accepted3/341ms26484 KiB
10Accepted3/3111ms53820 KiB
11Accepted3/3118ms55976 KiB
12Accepted3/3101ms42016 KiB
13Accepted3/3104ms41844 KiB
14Accepted3/3108ms45844 KiB
15Accepted3/3105ms42264 KiB
16Accepted3/3112ms48796 KiB
17Accepted3/3108ms48060 KiB
18Accepted3/3105ms45288 KiB
19Accepted3/3107ms46980 KiB
20Accepted3/3108ms46788 KiB
21Accepted3/3100ms43932 KiB
22Accepted3/3101ms43052 KiB