0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:52:02 +00:00

P1969 积木大赛

R41107243
This commit is contained in:
Baoshuo Ren 2020-11-02 21:13:18 +08:00 committed by Baoshuo Ren
parent 8803ab69fd
commit fbba911580
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

17
problem/P1969/P1969.cpp Normal file
View File

@ -0,0 +1,17 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, t, l = 0, ans = 0;
cin >> n;
while (n--) {
cin >> t;
if (t > l) {
ans += t - l;
}
l = t;
}
cout << ans << endl;
return 0;
}