QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#677641#7625. PathMartian148#WA 6ms3828kbC++20481b2024-10-26 13:10:102024-10-26 13:10:11

Judging History

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

  • [2024-10-26 13:10:11]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3828kb
  • [2024-10-26 13:10:10]
  • 提交

answer

#include <bits/stdc++.h>

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0); std::cout.tie(0);

    int ans = 0;
    int n, m; std::cin >> n >> m;
    std::vector<int> a(n), b(m);
    for (auto &x : a) std::cin >> x;
    for (auto &x : b) std::cin >> x;
    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]);
    
    std::cout << ans << '\n';
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3532kb

input:

4 4
1 3 3 1
8 10 8 5

output:

11

result:

ok single line: '11'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

4 2
5 7 8 10
10 3

output:

12

result:

ok single line: '12'

Test #3:

score: -100
Wrong Answer
time: 6ms
memory: 3828kb

input:

100000 100000
18394 24233 357 52481 18043 49271 55052 81632 30068 16351 74661 71867 28721 46743 54031 18957 25470 94751 25746 62355 22561 5373 99009 49079 48551 48807 41085 90981 82649 23014 74376 54517 95181 9445 10083 85937 95809 31477 38527 68803 91671 55251 17894 43472 69255 20256 21718 38213 12...

output:

-1918325335

result:

wrong answer 1st lines differ - expected: '6671609257', found: '-1918325335'