C++复制void dfs(int x){ if(c[x]==2){ puts("inf\ninf"); exit(0); } if(c[x])return; c[x]=2; for(pair<int,int>i:E[x])dfs(i.first); c[x]=1; }