Submission #441572

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4415722021-07-05 11:48:19azberjibiouFountain Parks (IOI21_parks)C++17
30 / 100
154 ms19732 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...