92502024-02-19 11:40:09Leventusz09Utazásszervezés (75 pont)csharpWrong answer 8/7541ms27532 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();
            /* V1 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[j];
                if (temp > 0){
                    o1++;
                    temp--;
                    if (Ig[i] - 1 + M < K) ret[Ig[i] - 1 + M]++;
                }
            }*/

            int o1 = 0;
            int[] b = new int[N];
            for(int i=0; i<C; i++){
                for(int j=0; j<N; j++) { 
                    if(b[j] < i+1){
                        b[j] = i + 1 + M;
                        o1++;
                    }
                }
            }

            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base8/75
1Accepted0/030ms22192 KiB
2Wrong answer0/039ms24812 KiB
3Wrong answer0/330ms22540 KiB
4Wrong answer0/429ms23028 KiB
5Accepted4/429ms23092 KiB
6Wrong answer0/429ms23572 KiB
7Accepted4/429ms23660 KiB
8Wrong answer0/435ms24232 KiB
9Wrong answer0/535ms24428 KiB
10Wrong answer0/535ms24940 KiB
11Wrong answer0/639ms25252 KiB
12Wrong answer0/641ms26552 KiB
13Wrong answer0/641ms26520 KiB
14Wrong answer0/641ms26928 KiB
15Wrong answer0/641ms27388 KiB
16Wrong answer0/641ms27172 KiB
17Wrong answer0/641ms27532 KiB