제출 #1340771

#제출 시각아이디문제언어결과실행 시간메모리
1340771SpyrosAlivTrain Or Bus (NOI25_trainorbus)C++20
100 / 100
1 ms344 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long

const int INF = 1e15;

void solve() {
    int n; cin >> n;
    int a[n+1], b[n+1];
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    int ans = 0;
    for (int i = 1; i <= n; i++) ans += min(a[i], b[i]);
    cout << ans << "\n";
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    while (t--) solve();
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...