# CQOI2018 Day1 社交网络

## Cqoi2018 Day1 社交网络

### Code：

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>inline void print(T x){if(x/10!=0)print(x/10);putchar(x%10+'0');}
template<class T>inline void writeln(T x){if(x<0)putchar('-');x=abs(x);print(x);putchar('\n');}
template<class T>inline void write(T x){if(x<0)putchar('-');x=abs(x);print(x);}
const int maxn=255;
const int Md=10007;
ll D[maxn][maxn],C[maxn][maxn],A[maxn][maxn];
int n,m;
/*==================Define Area================*/
ll GetInv(ll x) {
ll ans=1;
ll y=Md-2;
while(y) {
if(y&1) ans*=x,ans%=Md;
x*=x;
x%=Md;
y>>=1;
}
return ans;
}

int Gauss(ll A[255][255],int n) {
int i,j,k,r;
int f=1;
for(i=1;i<=n;i++) {
r=i;
for(j=i+1;j<=n;j++) {
if(A[j][i]>A[r][i]) r=j;
}
if(r!=i) {
for(j=1;j<=n;j++) {
swap(A[r][j],A[i][j]);
}
f*=-1;
}
for(k=i+1;k<=n;k++) {
int f=1ll*A[k][i]*GetInv(A[i][i])%Md;//注意是在模意义下的
for(j=i;j<=n;j++) {
A[k][j]=((A[k][j]-1ll*f*A[i][j]%Md)%Md+Md)%Md;
}
}
}
int ans=1;
for(int i=1;i<=n;i++) {
ans*=A[i][i];
ans%=Md;
}
ans=(f*ans%Md+Md)%Md;//最后求出余子式的值
return ans%Md;
}

int main() {
for(int i=1;i<=m;i++) {
int u,v;
}