45692023-03-30 08:20:10Leventusz19Utazásszervezés (75 pont)csharpAccepted 75/7545ms29340 KiB
/*using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Utazásszervezés{
    class Program{
        static void Main(string[] args){
            int[] in1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = in1[0], K = in1[1], M = in1[2], C = in1[3];
            int[] Ig = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] aas = new int[N];
            int aa;
            int o1 = 0;
            for(int i=0; i<C; i++){
                aa = -1;
                foreach (int j in aas) if (aas[j] > -1)
                    {
                        aas[j]--;
                        aa = j;
                    }
                if (aa != -1){
                    aas[aa] = M - 1;//Ig[i] + M - 1;
                    o1++;
                }
            }
            Console.WriteLine(o1);
            Console.ReadKey();
        }
    }
}
*/
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[] aas = new int[inp1[0]];
            int aa;
            int o1 = 0;
            for (int i = 0; i < inp1[3]; i++)
            {
                aa = -1;
                aa = Array.FindIndex(aas, x => x < inp2[i]);
                if (aa != -1)
                {
                    aas[aa] = inp2[i] + inp1[2] - 1;
                    o1++;
                }
            }
            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/032ms22000 KiB
2Accepted0/043ms27144 KiB
3Accepted3/330ms22316 KiB
4Accepted4/432ms22660 KiB
5Accepted4/430ms23004 KiB
6Accepted4/432ms23384 KiB
7Accepted4/432ms23528 KiB
8Accepted4/437ms24344 KiB
9Accepted5/537ms25092 KiB
10Accepted5/537ms25368 KiB
11Accepted6/639ms26356 KiB
12Accepted6/643ms27940 KiB
13Accepted6/641ms27824 KiB
14Accepted6/641ms28876 KiB
15Accepted6/641ms28972 KiB
16Accepted6/645ms29340 KiB
17Accepted6/643ms29184 KiB