QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#472464 | #7625. Path | inksamurai# | WA | 9ms | 3812kb | C++23 | 735b | 2024-07-11 16:37:13 | 2024-07-11 16:37:15 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rng(i,c,n) for(int i=c;i<n;i++)
#define fi first
#define se second
#define vec(...) vector<__VA_ARGS__>
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
void slv(){
int n,m;
cin>>n>>m;
vi a(n);
rep(i,n){
cin>>a[i];
}
vi b(m);
rep(i,m){
cin>>b[i];
}
int ans=0;
rep(i,n-1) ans+=abs(a[i]-a[i+1]);
rep(i,m-1) ans+=abs(b[i]-b[i+1]);
print(ans);
}
signed main(){
ios::sync_with_stdio(0),cin.tie(0);
slv();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
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: 3524kb
input:
4 2 5 7 8 10 10 3
output:
12
result:
ok single line: '12 '
Test #3:
score: -100
Wrong Answer
time: 9ms
memory: 3812kb
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 '