#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,arr[1000006],ans;
int main (){
cin>>n>>m;
for(ll i=0;i<2*n+2*m-2;i++) cin>>arr[i];
for(ll i=0;i<n+m-1;i++){
ans=ans+min(arr[i],arr[2*n+2*m-2-i-1]);
}
cout<<ans<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
93 ms |
7212 KB |
Output is correct |
2 |
Correct |
98 ms |
7368 KB |
Output is correct |
3 |
Correct |
93 ms |
7316 KB |
Output is correct |
4 |
Correct |
103 ms |
7504 KB |
Output is correct |
5 |
Correct |
102 ms |
7760 KB |
Output is correct |
6 |
Correct |
93 ms |
6680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
218 ms |
15188 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |