92452024-02-19 11:16:36Leventusz09Utazásszervezés (75 pont)csharpWrong answer 8/7541ms27968 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(){
            int[] in1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = in1[0],  //idegenvezetők
                K = in1[1],  //szezon
                M = in1[2],  //utazások hossza
                C = in1[3];  //utazások
            int[] Ig = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //Array.Sort(Ig);

            int temp = N;
            int o1 = 0;
            int[] ret = new int[K];

            for (int i = 0, j; i < C; i++){
                if (i > 0) for (j = Ig[i - 1] - 1; j < Ig[i] - 1; j++) temp += ret[/*Ig[j]-1*/j];
                if (temp > 0){
                    o1++;
                    temp--;
                    if (Ig[i] - 1 + M < K) ret[Ig[i] - 1 + M]++;
                }
            }
            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base8/75
1Accepted0/032ms22060 KiB
2Wrong answer0/041ms24888 KiB
3Wrong answer0/330ms22532 KiB
4Wrong answer0/429ms22788 KiB
5Accepted4/432ms23436 KiB
6Accepted4/430ms23328 KiB
7Wrong answer0/432ms23324 KiB
8Wrong answer0/435ms24624 KiB
9Wrong answer0/537ms24784 KiB
10Wrong answer0/537ms25620 KiB
11Wrong answer0/637ms26320 KiB
12Wrong answer0/639ms27056 KiB
13Wrong answer0/639ms27092 KiB
14Wrong answer0/639ms27384 KiB
15Wrong answer0/641ms27592 KiB
16Wrong answer0/641ms27872 KiB
17Wrong answer0/641ms27968 KiB