# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
33237 | model_code | Wiring (IOI17_wiring) | C++11 | 106 ms | 10648 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 <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
using namespace std;
typedef pair<int,bool> pie;
const bool BLUE = true, RED = false;
const int max_n = 200 * 1000; // TO BE DETERMINED
const int TOF = 100;
vector<pie> points;
long long d[max_n + 1], ps[max_n + 1];
int head[max_n];
long long val(int l, int r) {
int m = head[r], x = r+1 - m, y = m - l;
long long res = (ps[r+1] - ps[m]) - (ps[m] - ps[l]);
if (x > y) res -= (long long)(x-y) * points[m-1].first;
if (x < y) res += (long long)(y-x) * points[m].first;
return res;
}
long long min_total_length (vector <int> red, vector <int> blue) {
int n = blue.size(), m = red.size();
# | 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... |