Submission #675547

# Submission time Handle Problem Language Result Execution time Memory
675547 2022-12-27T12:30:40 Z brijeshSiwach Bigger segments (IZhO19_segments) Python 3
0 / 100
12 ms 2772 KB
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 time Memory Grader output
1 Incorrect 12 ms 2772 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 2772 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 2772 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 2772 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 2772 KB Output isn't correct
2 Halted 0 ms 0 KB -