# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
561779 | drkarlicio2107 | Parachute rings (IOI12_rings) | C++14 | 723 ms | 80256 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;
int N; int ima=0, tre=0;
pair <int, int> g [1000010];
struct rijesi {
int par [1000010];
int dub [1000010];
int deg [1000010];
int c=-1, md=0, zab=-1;
void dod (int a, int b){
if (a==zab || b==zab || md>2) return ;
//cout << a << " " << b << " " << zab << endl;
deg [a]++; deg [b]++;
md=max (md, max (deg [a], deg [b]));
while (par [a]!=-1) a=par [a];
while (par [b]!=-1) b=par [b];
if (dub [b]>dub [a]) swap (a, b);
//cout << dub [a] << " " << dub [b] << endl;
if (a==b){
if (c>-1) c=0;
else c=dub [a];
}
else {
dub [a]+=dub [b];
par [b]=a;
}
return ;
}
int ans (){
if (ima && c!=-1) return 0;
# | 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... |