Submission #66230


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <bits/stdc++.h>
using namespace std;
/*#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")*/
int main(){
/*ios::sync_with_stdio(false);
cin.tie(nullptr);*/
long long n,o=0,p=1;
cin>>n;
map<long long,long long> a,b;
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)<<endl;
return 0;
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 228 ms 17500 KB
1
in02.txt AC 246 ms 18848 KB
1
in03.txt AC 155 ms 12460 KB
1
in04.txt AC 216 ms 18036 KB
1
in05.txt AC 317 ms 25572 KB
1
in06.txt AC 335 ms 25508 KB
1
in07.txt AC 323 ms 25564 KB
1
in08.txt AC 317 ms 25628 KB
1
in09.txt AC 326 ms 25688 KB
1
in10.txt AC 298 ms 25620 KB
1
in11.txt AC 333 ms 25424 KB
1
in12.txt AC 335 ms 25480 KB
1
in13.txt AC 343 ms 25412 KB
1
in14.txt AC 20 ms 512 KB
1
in15.txt AC 268 ms 25576 KB
1
in16.txt AC 16 ms 548 KB
1
in17.txt AC 18 ms 520 KB
1
sample01.txt AC 16 ms 620 KB
1
sample02.txt AC 25 ms 720 KB
1