#include <bits/stdc++.h>
using namespace std;
#define sp " "
#define endl "\n"
#define pb push_back
#define pii pair<int, int>
#define st first
#define nd second
#define fileio() freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define N 200005
#define int long long
int arr[3][N];
int32_t main()
{
fastio();
int n, m;
cin>>n>>m;
for (int j = 0; j < 2; j++)
for (int i = 1; i <= n + m - 1; i++) cin>>arr[j][i];
int ans = 0;
for (int i = 1; i <= n + m - 1; i++)
{
//cout<<arr[0][i]<<sp<<arr[1][n + m - i]<<endl;
ans += min(arr[0][i], arr[1][n + m - i]);
}
cout<<ans<<endl;
cerr<<"time taken: "<<(float)clock() / CLOCKS_PER_SEC<<" seconds\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
7256 KB |
Output is correct |
2 |
Correct |
51 ms |
7316 KB |
Output is correct |
3 |
Correct |
46 ms |
7200 KB |
Output is correct |
4 |
Correct |
62 ms |
7500 KB |
Output is correct |
5 |
Correct |
61 ms |
7700 KB |
Output is correct |
6 |
Correct |
41 ms |
6644 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
124 ms |
13696 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |