add to gothib
This commit is contained in:
commit
523f45b46a
28 changed files with 419 additions and 0 deletions
29
spooky4you.py
Normal file
29
spooky4you.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""
|
||||
make a bunch tuples of range() objects for each decoration and then if in the object add n
|
||||
"""
|
||||
|
||||
n, l, max_spook = tuple(map(int, input().split(" ")))
|
||||
|
||||
candy = 0
|
||||
|
||||
decorations = []
|
||||
|
||||
for _ in range(n):
|
||||
a, b, s = tuple(map(int, input().split(" ")))
|
||||
decorations.append((range(a, b+1), s))
|
||||
|
||||
for i in range(l):
|
||||
spook_factor = 0
|
||||
|
||||
for deco, spookiness in decorations:
|
||||
if i in deco:
|
||||
spook_factor += abs(spookiness)
|
||||
|
||||
if spook_factor < max_spook:
|
||||
candy += 1
|
||||
|
||||
|
||||
if candy == 1:
|
||||
print(0) #off by one error lol
|
||||
else:
|
||||
print(candy)
|
Loading…
Add table
Add a link
Reference in a new issue