QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#249082#7625. Pathucup-team1766#WA 31ms4412kbC++23380b2023-11-12 00:30:332023-11-12 00:30:34

Judging History

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

  • [2023-11-12 00:30:34]
  • 评测
  • 测评结果:WA
  • 用时:31ms
  • 内存:4412kb
  • [2023-11-12 00:30:33]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;

  int a[n];
  int b[m];
  int diff = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i > 0) {
      diff += abs(a[i] - a[i - 1]);
    }
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    if (i > 0) {
      diff += abs(b[i] - b[i - 1]);
    }
  }
  cout << diff << endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3696kb

input:

4 2
5 7 8 10
10 3

output:

12

result:

ok single line: '12'

Test #3:

score: -100
Wrong Answer
time: 31ms
memory: 4412kb

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'