#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
int m,n;
cin >> m >> n;
vector<int> v1(m+n-1), v2(m+n-1);
for (int i=0; i<m+n-1; ++i){
cin >> v1[i];
}
for (int i=0; i<m+n-1; ++i){
cin >> v2[i];
}
reverse(v2.begin(),v2.end());
int sum = 0;
for (int i=0; i<n+m-1; ++i){
sum += min(v1[i],v2[i]);
}
cout << sum;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
66 ms |
3456 KB |
Output is correct |
2 |
Correct |
65 ms |
6776 KB |
Output is correct |
3 |
Correct |
75 ms |
6904 KB |
Output is correct |
4 |
Correct |
66 ms |
6776 KB |
Output is correct |
5 |
Correct |
71 ms |
6776 KB |
Output is correct |
6 |
Correct |
61 ms |
6776 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
147 ms |
6656 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |