QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#261871 | #7619. Make SYSU Great Again I | Monohydroxides# | WA | 0ms | 3640kb | C++20 | 569b | 2023-11-23 12:28:32 | 2023-11-23 12:28:33 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int b[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= m; i++) {
cin >> b[i];
}
long long ans = 0;
for (int i = 1; i < n; i++) {
ans += abs(a[i] - a[i + 1]);
}
for (int i = 1; i < m; i++) {
ans += abs(b[i] - b[i + 1]);
}
cout << ans << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
3 6
output:
0
result:
wrong answer Integer 0 violates the range [1, 3]