QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#261871#7619. Make SYSU Great Again IMonohydroxides#WA 0ms3640kbC++20569b2023-11-23 12:28:322023-11-23 12:28:33

Judging History

你现在查看的是最新测评结果

  • [2023-11-23 12:28:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2023-11-23 12:28:32]
  • 提交

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;
}

詳細信息

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]