#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#define F first
#define S second
#define P push
#define pb push_back
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define W while
#define R return
#define C continue
#define SI size()
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define SF(x) scanf("%I64d",&x)
#define SF2(x,y) scanf("%I64d%I64d",&x,&y)
#define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z)
#define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o)
#define all(v) v.begin(),v.end()
using namespace std;
const long long INF = 1e9+5e8;
const int MX=100005;
int n,par[MX],lvl[MX],cur,t[MX],res,dp[30][MX],up[MX],visit[MX];
vector<int> adj[MX];
bool is[MX];
void ADD(int node){
if(visit[node]==cur)R;
visit[node]=cur;
t[node]++;
if(t[node]==cur)res++;
}
void DSU(int x){
if(x==par[x])R;
DSU(par[x]);
lvl[x]+=lvl[par[x]];
par[x]=par[par[x]];
}
void build(int node){
if(adj[node].SI==3){
res=0;
cur++;
ADD(node);
for(auto i : adj[node])
ADD(i);
}
if(adj[node].SI>3){
res=0;
cur++;
ADD(node);
}
DSU(node);
}
void get_up(int A,int B){
res=0;
cur++;
if(lvl[A]<lvl[B]){
swap(A,B);
}
W(lvl[A]>lvl[B]){
ADD(A);
is[A]=1;
A=up[A];
}
W(A!=B){
ADD(A);
ADD(B);
is[A]=1;
is[B]=1;
A=up[A];
B=up[B];
}
is[A]=1;
ADD(A);
R;
}
void Init(int N_) {
n=N_;
res=n;
for(int i=0;i<n;i++)
par[i]=i,up[i]=i;
}
void Link(int A, int B) {
if(res==0)R;
adj[A].pb(B);
adj[B].pb(A);
build(A);
build(B);
if(par[A]==par[B]){
// cout<<'s';
if(res){
if(is[A]&&is[B]){
cur++;
res=0;
ADD(A);
ADD(B);
R;
}
get_up(A,B);
}
else{
}
}
else{
par[par[A]]=par[B];
up[A]=B;
dp[0][A]=B;
}
}
int CountCritical() {
return res;
}
/*
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define inbuf_len 1 << 16
#define outbuf_len 1 << 16
void Init(int N);
int CountCritical();
void Link(int a, int b);
int main() {
int tmp;
/* Set input and output buffering */
char *inbuf, *outbuf;
inbuf = (char*) malloc(inbuf_len * sizeof(char));
outbuf = (char*) malloc(outbuf_len * sizeof(char));
tmp = setvbuf(stdin, inbuf, _IOFBF, inbuf_len);
tmp = setvbuf(stdout, outbuf, _IOFBF, outbuf_len);
int N, L;
tmp = scanf("%d %d", &N, &L);
assert(tmp == 2);
Init(N);
int i;
for (i = 0; i < L; i++) {
int A, B;
tmp = scanf("%d", &A);
if (A == -1) {
int critical;
critical = CountCritical();
cout<<critical<<endl;
} else {
tmp = scanf("%d", &B);
assert(tmp == 1);
Link(A, B);
}
}
return 0;
}
*/
Compilation message
rings.cpp:2:10: fatal error: decoder.h: No such file or directory
#include "decoder.h"
^~~~~~~~~~~
compilation terminated.