mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1969 积木大赛
R41107243
This commit is contained in:
parent
8803ab69fd
commit
fbba911580
17
problem/P1969/P1969.cpp
Normal file
17
problem/P1969/P1969.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user