# TopCoder

\begin{align} AC \times 2^9 \\ \text{New TIOJ ?} \end{align}

100.0% (11/11)

58.8% (20/34)

# Description

#### Original Input Format

• $1 \le N \le 100$
• $1 \le M \le 500$
• $1 \le a_i, b_i \le N$
• 保證圖是 連通 並且 簡單 （不存在重邊、自環）的

#### Original Sample Input

Sample Input 1:
3 3
1 2
2 3
3 1

Sample Input 2:
4 3
1 2
2 3
3 4


#### Original Sample Output

Sample Output 1:
1

Sample Output 2:
2


#### Original Limits

• Time Limit: 2 second
• Memory Limit: 256 MB

#### Program To Be Hacked

#include <bits/stdc++.h>
using namespace std;

int n , m , u[106] , ans;
pair<int,int> x[506];

int main(){
clock();
cin >> n >> m;
for(int i = 0 ;i < m; ++i) cin >> x[i].first >> x[i].second;
for(int times = 0; times < 5000 * 5000; ++ times){
random_shuffle(x , x + m);
memset(u,0,sizeof(u));
int cnt = 0;
for(int i = 0 ;i < m; ++i) if(u[x[i].first] == 0 && u[x[i].second] == 0){
u[x[i].first] = 1;
u[x[i].second] = 1;
cnt ++;
}
ans = max(ans , cnt);
if(1.0 * clock() / CLOCKS_PER_SEC > 1.99) break;
}
cout << ans << endl;
return 0;
}


#### Sample Code

#include <cstdio>
int main() {
printf("3 3\n1 2\n2 3\n3 1\n");
}