117412024-11-08 15:26:12balintUtazásszervezés (75 pont)python3Accepted 75/7532ms4152 KiB
def main():
    N, K, M, C = map(int, input().split())
    nums = map(int, input().split())
    if K < M:
        print("0")
    else:
        trips = 0
        season = [0] * K

        for i in nums:
            old_season = season
            for j in range(i - 1, i - 1 + M):
                if season[j] + 1 > N:
                    season = old_season
                    break
                season[j] += 1
            else:
                trips += 1

    print(trips)


main()
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/016ms2872 KiB
2Accepted0/032ms4016 KiB
3Accepted3/317ms2992 KiB
4Accepted4/416ms3124 KiB
5Accepted4/416ms2872 KiB
6Accepted4/416ms2872 KiB
7Accepted4/417ms3068 KiB
8Accepted4/416ms2964 KiB
9Accepted5/517ms3128 KiB
10Accepted5/518ms3576 KiB
11Accepted6/621ms3384 KiB
12Accepted6/628ms3768 KiB
13Accepted6/628ms3892 KiB
14Accepted6/628ms4152 KiB
15Accepted6/629ms3912 KiB
16Accepted6/629ms3880 KiB
17Accepted6/630ms3896 KiB