96602024-02-23 18:34:4242thebestestUtazásszervezés (75 pont)python3Accepted 75/7575ms18512 KiB
from sys import stdin
from collections import defaultdict
N, hossz, utaz, napok = [int(x) for x in stdin.readline().split()]
igenyek_list = [int(x) for x in stdin.readline().split()]
igenyek = defaultdict(int)
for i in igenyek_list:
	igenyek[i] += 1
utazasok = 0

for i in range(N):
	maradt = 0
	for nap in range(1, hossz+1):
		if maradt > 0:
			maradt -= 1
			continue
		else:
			if igenyek[nap] > 0:
				igenyek[nap] -= 1
				maradt = utaz-1
				utazasok += 1
		#print(i, nap, igenyek, utazasok, maradt)
print(utazasok)
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/020ms11804 KiB
2Accepted0/071ms16116 KiB
3Accepted3/320ms12232 KiB
4Accepted4/420ms12632 KiB
5Accepted4/420ms12924 KiB
6Accepted4/419ms12644 KiB
7Accepted4/421ms13084 KiB
8Accepted4/435ms15780 KiB
9Accepted5/535ms15712 KiB
10Accepted5/541ms15852 KiB
11Accepted6/641ms16660 KiB
12Accepted6/654ms18092 KiB
13Accepted6/652ms18220 KiB
14Accepted6/667ms18024 KiB
15Accepted6/671ms18136 KiB
16Accepted6/671ms18292 KiB
17Accepted6/675ms18512 KiB