Submission #1179484

#TimeUsernameProblemLanguageResultExecution timeMemory
1179484generatedscriptStove (JOI18_stove)Pypy 3
0 / 100
135 ms48796 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)

Compiling 'stove.py'...

=======
  adding: __main__.pyc (deflated 29%)

=======
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...