Submission #548418

#TimeUsernameProblemLanguageResultExecution timeMemory
548418arstalchanGlobal Warming (NOI13_gw)Pypy 3
6 / 40
1096 ms34312 KiB
L = [int(input()) for x in range(int(input()))] L.insert(0, 0) L.append(0) ans = 0 cur = 0 values = {} for x in range(1, len(L) - 1): if L[x-1] <= L[x] >= L[x+1]: if L[x] in values: values[L[x]] += 1 else: values[L[x]] = 1 if L[x-1] >= L[x] <= L[x+1]: if L[x] in values: values[L[x]] -= 1 else: values[L[x]] = -1 for x in sorted(values)[::-1]: cur += values[x] ans = max(ans, cur) print(ans)
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...