Submission #66222


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n;
long long o=0,p=0;
cin>>n;
vector<long long> a(n),b(n);
for(int i=0;i<n;++i) cin>>a[i];
for(int i=0;i<n;++i){
cin>>b[i];
o+=abs(a[i]-b[i]);
p+=abs(a[n-i-1]-b[i]);
}
cout<<min(o,p+1)<<"\n";
return 0;
}

ステータス

項目 データ
問題 1435 - Same Sequence
ユーザー名 r2031
投稿日時 2021-04-27 16:28:16
言語 C++17
状態 Accepted
得点 3
ソースコード長 303 Byte
最大実行時間 144 ms
最大メモリ使用量 3764 KB

セット

セット 得点 Cases
1 ALL 3 / 3 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 105 ms 2652 KB
1
in02.txt AC 94 ms 2792 KB
1
in03.txt AC 67 ms 2136 KB
1
in04.txt AC 84 ms 2916 KB
1
in05.txt AC 113 ms 3764 KB
1
in06.txt AC 118 ms 3548 KB
1
in07.txt AC 120 ms 3584 KB
1
in08.txt AC 134 ms 3496 KB
1
in09.txt AC 112 ms 3544 KB
1
in10.txt AC 92 ms 3588 KB
1
in11.txt AC 127 ms 3632 KB
1
in12.txt AC 113 ms 3680 KB
1
in13.txt AC 144 ms 3600 KB
1
in14.txt AC 18 ms 576 KB
1
in15.txt AC 65 ms 3620 KB
1
in16.txt AC 29 ms 464 KB
1
in17.txt AC 29 ms 436 KB
1
sample01.txt AC 19 ms 528 KB
1
sample02.txt AC 30 ms 628 KB
1