# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
289052 | SamAnd | 전선 연결 (IOI17_wiring) | C++17 | 43 ms | 2680 KiB |
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 "wiring.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
typedef long long ll;
const int N = 100005;
ll ans;
int n, m;
long long min_total_length(std::vector<int> r, std::vector<int> b)
{
n = sz(r);
m = sz(b);
for (int i = 0; i < n; ++i)
{
ans -= r[i];
}
for (int i = 0; i < m; ++i)
{
ans += b[i];
}
for (int i = 0; i < m - n; ++i)
ans -= r[n - 1];
for (int i = 0; i < n - m; ++i)
ans += b[0];
return ans;
}
Compilation message (stderr)
# | 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... |