Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
101954 | Tom0 | 序列变换 | C++ | 解答错误 | 13 | 53 MS | 248 KB | 291 | 2023-09-11 14:41:03 |
#include <iostream> #include <algorithm> using namespace std; typedef long long LL; int main() { LL n, x, ans = 0, last = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; if (x > last) ans += x - last; last = x; } cout << ans << endl; return 0; }