Submission #467220

#TimeUsernameProblemLanguageResultExecution timeMemory
467220NursikColouring a rectangle (eJOI19_colouring)C++14
0 / 100
126 ms15112 KiB
#include <bits/stdc++.h> #define pb push_back #define ll long long #define ld long double #define f first #define s second #define mp make_pair const ll maxn = 1e6 + 5, maxm = 1e5 + 11, maxk = 6; const ll inf = 1000000000, mod = inf + 7, mod2 = 998244353; const ll pa = 31; using namespace std; ll m, n; ll cost[maxn], cost2[maxn]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> m >> n; for (int i = 1; i <= n + m - 1; ++i){ cin >> cost[i]; } for (int i = 1; i <= n + m - 1; ++i){ cin >> cost2[i]; } ll ans = 0; for (int i = 1; i <= n + m - 1; ++i){ ans = ans + min(cost[i], cost2[i]); } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...