#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) std::cout<<(p)<>N>>M; int a,b,c; rep(i,N)rep(j,N)rg[i][j]=0; rep(i,M){ cin>>a>>b>>c; rg[a][b] = c; } vector data; rep(i,N){ data.push_back(i); } int ans=-1; int temp; do{ temp = 0; rep(i,N){ for(int k=i+1;k