# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789949 | Amylopectin | Parachute rings (IOI12_rings) | C++14 | 4038 ms | 2388 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 <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int mxn = 4e4 + 10;
// const int mxn = 110;
vector<int> pat[mxn] = {},clii;
int n,u[mxn] = {},ccou,pcou[mxn] = {},p1,p2,rdep,of,of2,cyc[mxn] = {},cymi,depp[mxn] = {};
int re(int cn,int be,int pro)
{
int i,j,fn,cou = 0;
u[cn] = 1;
for(i=0; i<pat[cn].size(); i++)
{
fn = pat[cn][i];
if(fn == pro)
{
continue;
}
cou ++;
if(fn == be)
{
continue;
}
if(u[fn] == 1)
{
of2 = 1;
continue;
}
re(fn,cn,pro);
if(of == 1)
{
return 0;
}
}
if(cou > 2)
{
of = 1;
}
// if(cou == 1)
// {
// of2 = 1;
// }
return 0;
}
void Init(int nn)
{
int i,j,m;
n = nn;
// for(i=0; i<n; i++)
// {
// ggr[i] = i;
// typ[i] = 0;
// sta[i] = 1;
// nmem[i] = 1;
// }
return ;
}
void Link(int cl, int cr)
{
pat[cl].push_back(cr);
pat[cr].push_back(cl);
}
int CountCritical()
{
int i,j,m,ans = 0,cn,cm,fn,fm,cou,fal;
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
u[j] = 0;
}
fal = 0;
for(j=0; j<n; j++)
{
if(j != i && u[j] == 0)
{
of = 0;
of2 = 0;
re(j,-1,i);
if(of == 1 || of2 == 1)
{
fal = 1;
break;
}
}
}
// for(j=0; j<pat[i].size(); j++)
// {
// cn = pat[i][j];
// if(u[j] == 0)
// {
// of = 0;
// of2 = 0;
// re(cn,-1,i);
// if(of == 1 || of2 == 1)
// {
// fal = 1;
// break;
// }
// }
// }
if(fal == 0)
{
ans ++;
}
}
return ans;
}
Compilation message (stderr)
# | 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... |