# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1179484 | generatedscript | Stove (JOI18_stove) | Pypy 3 | 135 ms | 48796 KiB |
i = input().split()
i = [int(x) for x in i]
GuestCount = i[0]
Matches = i[1]
IsStoveOn = False
StoveRunTime = 0
GuestTimes = []
for gtime in range(GuestCount):
GuestTimes.append(int(input()))
CurrentTime = 0
EndTime = GuestTimes[len(GuestTimes)-1]
if Matches < GuestCount:
if Matches == 1:
print(EndTime)
else:
count = 0
for g in range(len(GuestTimes)):
currg = GuestTimes[g]
if currg < EndTime:
if GuestTimes[g+1]-currg >= 3:
count += 1
# print(currg, GuestTimes[g+1])
# print("count is: "+str(count))
print((Matches-count)+GuestCount)
else:
print(GuestCount)
Compilation message (stdout)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |