| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 101955 | Tom0 | 序列变换 | C++ | Accepted | 100 | 52 MS | 1040 KB | 315 | 2023-09-11 14:49:55 |
#include <iostream> #include <cmath> using namespace std; typedef long long LL; int n, a[200010], d[200010]; LL ans; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) ans += abs(a[i] - a[i - 1]); cout << ans << endl; return 0; }