Submission #675547

#TimeUsernameProblemLanguageResultExecution timeMemory
675547brijeshSiwachBigger segments (IZhO19_segments)Cpython 3
0 / 100
12 ms2772 KiB
def minimumOperations(arr): n = len(arr) dp = [0] * n for i in range(1, n): if arr[i] >= arr[i-1]: dp[i] = dp[i-1] else: dp[i] = min(dp[i-2] + 1, dp[i-3] + 1) return dp[n-1] n=input() arr=list(map(int,input().split())) print(minimumOperations(arr))
#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...