USACO3.3.1求欧拉路入门,邻接矩阵

/*
ID: 19930323
PROG: fence
LANG: C++
HINT: 参考usaco第三章第三节的关于Eulerian Tour的讲解
*/
#include 
#include 
#include 
#include 
#define NN 502
using namespace std;

int n=0,m,sum=0;
int degree[NN];
int linkk[NN][NN];
vector path;

void dfs(int u)
{
    if (sum==m) return ;
    for (int i=1; i<=n; i++)
    {
        if (linkk[u][i])
        {
            linkk[u][i]--;
            linkk[i][u]--;
            sum++;
            dfs(i);
            path.push_back(i);
        }
    }
}

int main()
{
    int mini=501;
    freopen("fence.in","r",stdin);
    freopen("fence.out","w",stdout);

    for (int i=0; i>m;
    int i;
    for (i=1; i<=m; i++)
    {
        int x,y;
        cin>>x>>y;
        mini=minix ? n:x;
        n=n>y ? n:y;
        degree[x]++; degree[y]++;
        linkk[x][y]++;
        linkk[y][x]++;
    }
    for (i=1; i<=n; i++)
       if (degree[i]%2==1)
       {
           mini=i;
           break;
       }
    cout<=0; i--) cout<

你可能感兴趣的:(ACM,图论)