# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
441572 | azberjibiou | Fountain Parks (IOI21_parks) | C++17 | 154 ms | 19732 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 "parks.h"
#include <bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
const int mxN=200020;
int N;
int A[3][mxN];
bool Chk[3][mxN];
int par[mxN];
vector <int> u, v, a, b;
int findpar(int a)
{
return (par[a]==a ? a : par[a]=findpar(par[a]));
}
void onion(int a, int b)
{
int p=findpar(a), q=findpar(b);
if(p!=q) par[p]=q;
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
N=x.size();
for(int i=1;i<=100000;i++) for(int j=0;j<3;j++) A[j][i]=-1;
for(int i=0;i<N;i++)
{
if(x[i]==2) A[0][y[i]/2]=i;
else if(x[i]==4) A[1][y[i]/2]=i;
else A[2][y[i]/2]=i;
}
for(int i=0;i<N;i++) par[i]=i;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |