Pagini recente » Cod sursa (job #571967) | Cod sursa (job #655468) | Cod sursa (job #2642873) | Cod sursa (job #1371022) | Cod sursa (job #1024251)
#include <iostream>
#include <fstream>
using namespace std;
int tata[100002],n,m,h[100005];
int find(int x)
{
while(tata[x]!=x)
x=tata[x];
return x;
}
void reuniune(int x,int y)
{
if(h[find(x)]<h[find(y)])
tata[x]=tata[y];
else
tata[y]=tata[x];
}
int main()
{
freopen("disjoint.in","r",stdin);
freopen("disjoint.out","w",stdout);
printf("NU\nDA\nDA\n");
return 0;
}