Submission #1314754

#TimeUsernameProblemLanguageResultExecution timeMemory
1314754vikgupRasvjeta (COCI17_rasvjeta)Pypy 3
Compilation error
0 ms0 KiB
def calc_count(dist, rng):
    mod = dist%rng
    count = dist//rng
    if mod == 0:
	return count
    return count + 1

n = int(input())
m = int(input())
k = int(input())
rnge = (2*k) + 1
lights = []
for _ in range(m):
    lights.append(int(input()))
ranges = []
ranges.append(0)
for l in lights:
    ranges.append(l-k)
    ranges.append(l+k)
ranges.append(n+1)
ans = 0
for i in range(0,len(ranges),2):
    diff = ranges[i+1]-ranges[i]
    if diff <= 1:
	continue
    else:
        ans += calc_count(diff, rnge)
print(ans)

Compilation message (stdout)

Compiling 'rasjveta.py'...
*** Sorry: TabError: inconsistent use of tabs and spaces in indentation (line 5)

=======