45072023-03-29 11:37:05TortelliniJrUtazásszervezés (75 pont)csharpAccepted 75/7543ms30556 KiB
using System;
using System.Linq;
namespace Utazásszervezés
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inp1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] inp2 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] végek = new int[inp1[0]];
            int a;
            int sz = 0;
            for (int i = 0; i < inp1[3]; i++)
            {
                a = -1;
                a = Array.FindIndex(végek, x => x < inp2[i]);
                if (a != -1)
                {
                    végek[a] = inp2[i] + inp1[2] - 1;
                    sz++;
                }
            }
            Console.WriteLine(sz);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/030ms21764 KiB
2Accepted0/043ms27200 KiB
3Accepted3/330ms22840 KiB
4Accepted4/430ms22952 KiB
5Accepted4/430ms23140 KiB
6Accepted4/432ms23768 KiB
7Accepted4/432ms24096 KiB
8Accepted4/437ms24976 KiB
9Accepted5/535ms25652 KiB
10Accepted5/537ms26164 KiB
11Accepted6/639ms27356 KiB
12Accepted6/641ms29164 KiB
13Accepted6/641ms28624 KiB
14Accepted6/641ms30300 KiB
15Accepted6/641ms30556 KiB
16Accepted6/641ms30488 KiB
17Accepted6/641ms30532 KiB