案例号输出错误导致不能ac
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>
const int MAXN = 2005;
int n;
int F[2 * MAXN];
int find(int i) {
int r = i;
while (F[r] != -1)
r = F[r];
int x = i, temp;
while (x != r) {
temp = F[x];
F[x] = r;
x = temp;
}
return r;
}
void union_set(int a, int b) {
int u = find(a), v = find(b);
if (u != v) F[v] = u;
}
using namespace std;
int main() {
#ifdef LOCAL
freopen("zz_in.txt", "r", stdin);
freopen("zz_op.txt", "w", stdout);
#endif
int t, i, j, k;
cin >> t;
int no = 0, found;
while (t--) {
no++;
memset(F, -1, sizeof(F));
int m;
int a, b;
scanf("%d %d", &n, &m);
found = 0;
for (i = 0; i < m; i++) {
scanf("%d %d", &a, &b);
if (find(a) == find(b)) {
found = 1;
} else {
union_set(a, b + n);
union_set(a + n, b);
}
}
printf("Scenario #%d:\n", no);//no忘了写(案例号输出错误导致不能ac)
if (found)
printf("Suspicious bugs found!\n\n");
else
printf("No suspicious bugs found!\n\n");
}
#ifdef LOCAL
printf("Time used = %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
return 0;
}