# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
46947 | SpaimaCarpatilor | Wiring (IOI17_wiring) | C++17 | 1080 ms | 26612 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;
int N, x[200009], col[200009], minD[200009];
long long dp[200009], s[200009];
const int INF = 1e9 + 100;
void init (vector < int > &rr, vector < int > &bb)
{
int pntr1 = 0, pntr2 = 0;
while (pntr1 < rr.size () || pntr2 < bb.size ())
{
if (pntr2 == bb.size () || (pntr1 < rr.size () && rr[pntr1] < bb[pntr2]))
x[++N] = rr[pntr1], pntr1 ++, col[N] = 0;
else
x[++N] = bb[pntr2], pntr2 ++, col[N] = 1;
}
int lst[2];
lst[0] = lst[1] = -1;
for (int i=1; i<=N; i++)
{
if (lst[col[i] ^ 1] == -1) minD[i] = INF;
else minD[i] = x[i] - lst[col[i] ^ 1];
lst[col[i]] = x[i];
}
lst[0] = lst[1] = -1;
for (int i=N; i>=1; i--)
{
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... |