简答题
偏难
#17303
试题名称 :数组清零 时间限制 :1.0 s 内存限制 :512.0 MB
试题名称:数组清零
时间限制:1.0 s
内存限制:512.0 MB


答案与解析
正确答案:<pre class="brush:python;toolbar:false">n = int(input())
a = list(map(int, input().split()))
res = a[0]
for i in range(1, n):
if a[i] > a[i-1]:
res += a[i] - a[i-1]
print(res)</pre><p><br/></p>
这道题暂未补解析。