#include <bits/stdc++.h>
using namespace std;
#define Int register int
#define int long long
#define MAXN 25
int n,m;
int A[MAXN][MAXN];
int Gauss ()
{
int Ans = 1,tot = 1;
for (Int i = 2;i <= n;++ i)
{
for (Int k = i + 1;k <= n;++ k)
while (A[k][i])
{
int d = A[i][i] / A[k][i];
for (Int j = i;j <= n;++ j) A[i][j] = A[i][j] - d * A[k][j];
swap (A[i],A[k]);
tot *= -1;
}
Ans = Ans * A[i][i];
}
return tot * Ans;
}
int read ()
{
int x = 0;char c = getchar();int f = 1;
while (c < '0' || c > '9'){if (c == '-') f = -f;c = getchar();}
while (c >= '0' && c <= '9'){x = (x << 3) + (x << 1) + c - '0';c = getchar();}
return x * f;
}
void write (int x)
{
if (x < 0){x = -x;putchar ('-');}
if (x > 9) write (x / 10);
putchar (x % 10 + '0');
}
signed main()
{
int T = read ();
while (T --)
{
memset (A,0,sizeof (A));
n = read (),m = read ();
for (Int i = 1;i <= m;++ i)
{
int x = read (),y = read ();
A[x][x] ++,A[y][y] ++;
A[x][y] --,A[y][x] --;
}
write (Gauss ()),putchar ('\n');
}
return 0;
}剪贴板
剪贴板 rvkk0470
剪贴板信息
剪贴板信息
- 收录
- 更新