87872024-01-30 11:43:27Leventusz09Utazásszervezés (75 pont)csharpWrong answer 4/7541ms28280 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; i<C; i++){
                if(temp > 0){
                    o1++;
                    temp--;
                    if (Ig[i] + M < K) ret[Ig[i] + M]++;
                }
                temp+=ret[Ig[i]];
            }
            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base4/75
1Accepted0/030ms22220 KiB
2Wrong answer0/039ms24708 KiB
3Wrong answer0/330ms22796 KiB
4Wrong answer0/432ms23220 KiB
5Accepted4/432ms23892 KiB
6Wrong answer0/432ms24460 KiB
7Wrong answer0/432ms24192 KiB
8Wrong answer0/435ms24936 KiB
9Wrong answer0/537ms25556 KiB
10Wrong answer0/537ms25988 KiB
11Wrong answer0/637ms26748 KiB
12Wrong answer0/639ms27572 KiB
13Wrong answer0/641ms27264 KiB
14Wrong answer0/641ms28072 KiB
15Wrong answer0/641ms28052 KiB
16Wrong answer0/641ms28280 KiB
17Wrong answer0/639ms28200 KiB