This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#ifndef ARTHUR_LOCAL
#include "wiring.h"
#endif
using namespace std;
using ll = long long;
ll min_total_length(vector<int> R, vector<int> B)
{
ll ans = 0;
for(auto r:R) ans -= ll(r);
for(auto b:B) ans += ll(b);
if(B.size() > R.size()) ans -= ll(B.size()-R.size())*ll(R.back());
else ans += ll(R.size()-B.size())*ll(B[0]);
return ans;
}
#ifdef ARTHUR_LOCAL
int main()
{
cout << min_total_length({1,2},{3,4}) << endl;
}
#endif
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |