#include #include #include #include #include #include #include #define MAXINT 99999999 #define MININT -1 using namespace std; struct Node{ int l; int w; }node[5000+4]; int vis[5000+4]; bool cmp(Node x,Node y) {if(x.l=node[pre].w) {vis[j]=1;pre=j;} } } } cout<