제출 #675553

#제출 시각아이디문제언어결과실행 시간메모리
675553brijeshSiwachBigger segments (IZhO19_segments)Cpython 3
0 / 100
13 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] # Read the array from the user arr = list(map(int, input().split())) # Print the result 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...