92702024-02-19 17:08:0442thebestestUtazásszervezés (75 pont)python3Time limit exceeded 4/75282ms12552 KiB
from sys import stdin
N, K, M, C = [int(x) for x in stdin.readline().split()]
igenyek = [int(x) for x in stdin.readline().split()]
idegenvezetok = [0] * N
utazasok = 0

for i in range(1, K-M+2):
    #print(0 in idegenvezetok and i in igenyek)
    while 0 in idegenvezetok and i in igenyek:
        idegenvezetok[idegenvezetok.index(0)] = M+1
        utazasok += 1
    for x in range(N):
        if idegenvezetok[x] != 0:
            idegenvezetok[x] -= 1
    #print(i, idegenvezetok, utazasok)
print(utazasok)
SubtaskSumTestVerdictTimeMemory
base4/75
1Accepted0/017ms11284 KiB
2Time limit exceeded0/0252ms5012 KiB
3Wrong answer0/317ms11876 KiB
4Wrong answer0/417ms11408 KiB
5Accepted4/417ms11540 KiB
6Wrong answer0/417ms11648 KiB
7Wrong answer0/417ms11960 KiB
8Wrong answer0/456ms11836 KiB
9Wrong answer0/5159ms12552 KiB
10Time limit exceeded0/5272ms4756 KiB
11Time limit exceeded0/6263ms4812 KiB
12Time limit exceeded0/6279ms5572 KiB
13Time limit exceeded0/6282ms5464 KiB
14Time limit exceeded0/6279ms5908 KiB
15Time limit exceeded0/6252ms5924 KiB
16Time limit exceeded0/6250ms5812 KiB
17Time limit exceeded0/6275ms5856 KiB