48702023-04-04 11:08:22czitaNegáló rendezés (55 pont)csharpAccepted 55/55112ms54524 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace negalorendezes
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Dictionary<long, long> m = new Dictionary<long, long>();
            long mini = 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]]++;
                mini = Math.Min(mini, a[i]);
            }
            long mod = 1000000007,db=1;
            foreach (var item in m)
            {
                if (item.Key!=mini)
                {
                    db = db*(item.Value + 1) % mod;
                }
            }
            Console.WriteLine(db);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/035ms21936 KiB
2Accepted0/0108ms44756 KiB
3Accepted2/235ms22588 KiB
4Accepted2/235ms23116 KiB
5Accepted2/235ms23224 KiB
6Accepted2/235ms23592 KiB
7Accepted3/335ms23936 KiB
8Accepted2/234ms23964 KiB
9Accepted3/339ms25012 KiB
10Accepted3/3104ms52736 KiB
11Accepted3/3112ms54524 KiB
12Accepted3/397ms40880 KiB
13Accepted3/3104ms40988 KiB
14Accepted3/3103ms45816 KiB
15Accepted3/3103ms42160 KiB
16Accepted3/3105ms48480 KiB
17Accepted3/3105ms47664 KiB
18Accepted3/3103ms44276 KiB
19Accepted3/3104ms45656 KiB
20Accepted3/3107ms45324 KiB
21Accepted3/396ms42084 KiB
22Accepted3/3100ms41848 KiB