diff --git a/problem/P1969/P1969.cpp b/problem/P1969/P1969.cpp new file mode 100644 index 00000000..f6da5fc3 --- /dev/null +++ b/problem/P1969/P1969.cpp @@ -0,0 +1,17 @@ +#include + +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; +}