# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023543 | Rolo678 | Stone Arranging 2 (JOI23_ho_t1) | C++14 | 0 ms | 0 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<bits/stdc++.h>
using namespace std;
vector<int>a(2e5+5);
map<int,int>m;
vector<int>p(2e5+5);
vector<int>s(2e5+5);
void make_set(int n)
{
for(int i = 1;i<=n;i++)
{
p[i] = i;
s[i] =1;
}
}
int find_parent (int v)
{
if(v == p[v])
{
return v;
}
return p[v] = find_parent(p[v]);
}
void union_sets(int a,int b)
{
int pa = find_parent(a);
int pb = find_parent(b);
if(pa!=pb)
{
if(pb > pa)swap(pa,pb);
p[pb] = pa;
size [a] += size[b];
}
}
int main()
{
int n;
cin >> n;
make_set(n);
vector<stack<int>>v(n+1,stack<int>())
set<int>se;
for(int i = 1;i<=n;i++)
{
cin >> a[i];
se.insert(a[i])
}
}