题目
\(CQOI\)的题都这么裸的吗??
做法
有向图,指向叶子方向 \(D^{out}(G)-A(G)\)
至于证明嘛,反正也就四个定理,先挖个坑,省选后再来补
My complete code
#include#include #include #include #include #include using namespace std;typedef int LL;const int p=10007;const int maxn=300;inline LL Read(){ LL x(0),f(1); char c=getchar(); while(c<'0'||c>'9'){ if(c=='-') f=-1; c=getchar(); } while(c>='0'&&c<='9') x=(x<<3)+(x<<1)+c-'0',c=getchar(); return x*f;}LL n,m;LL D[maxn][maxn];inline LL Pow(LL base,LL b){ LL ret(1); while(b){ if(b&1) ret=ret*base%p; base=base*base%p, b>>=1; }return ret;}inline LL Solve(){ LL N(n),tr(0),ans(1); for(LL i=2;i<=N;++i){ LL mx(i); for(LL j=i+1;j<=N;++j) if(D[mx][i]