Thanks to the classic questions provided by Huai Ge, I have learned the idea of a second answer!
// The second answer + the largest stream <br/> // finally, I have seen the second answer in the legend. <br/> // if there is no second answer, how can I not think about this question? <br/> // The idea is this: Sort all edge weights, record the upper and lower bounds of edge weights <br/> // start the second answer. According to the enumerated answer diagram, add the edge of the answer with the maximum edge weight less than or equal to enumeration to the graph <br/> // (bidirectional edge) and set their capacity to 1, with multiple edges, the capacity is increased by 1, followed by the FF maximum stream. If the maximum stream is greater than or equal to T, it indicates that the answer meets the conditions <br/> // remember that the answer is not necessarily the correct answer at this time, and the answer can be smaller. Continue to the second point and know the final answer <br/> // after the second point, the final answer is the lower bound, that is, the L in the program, rather than the mid median! Remember ~~ This is because this wa is used several times <br/> # include <iostream> <br/> # include <queue> <br/> # include <vector> <br/> using namespace std; <br/> const int maxn = 205, maxm = 40005; <br/> const int INF = 2147483647; <br/> struct edge <br/> {<br/> int U, V, W; <br/> edge (INT Uu, int VV, int ww) <br/> {u = Uu; V = vv; W = WW ;}< br/>}; <br/> int rflow [maxn], flow [maxn] [maxn], Cap [maxn] [maxn], pre [maxn]; <br/> int L, R, mid, maxflow; <br/> int N, T, P; <br/> vect Or <edge> E; <br/> void buildgraph (INT ans) <br/>{< br/> memset (Cap, 0, sizeof (CAP )); <br/> for (INT I = 0; I <E. size (); ++ I) <br/>{< br/> If (E [I]. W <= ans) <br/>{< br/> CAP [E [I]. u] [E [I]. v] + = 1; <br/> CAP [E [I]. v] [E [I]. u] + = 1; <br/>}< br/> void ff () // FF template <br/>{< br/> queue <int> q; <br/> memset (flow, 0, sizeof (flow )); <br/> maxflow = 0; <br/> while (1) <br/> {<br/> memset (rflow, 0, sizeof (rflow )); <br/> r Flow [1] = inf; <br/> q. Push (1); <br/> while (! Q. empty () <br/>{< br/> int u = Q. front (); q. pop (); <br/> for (INT v = 1; v <= N; ++ V) <br/> If (rflow [v] = 0 & Cap [u] [v]> flow [u] [v]) <br/>{< br/> pre [v] = u; <br/> q. push (V); <br/> rflow [v] = min (rflow [u], Cap [u] [v]-flow [u] [v]); <br/>}< br/> If (rflow [N] = 0) break; <br/> for (INT u = N; u! = 1; u = pre [u]) <br/>{< br/> flow [pre [u] [u] + = rflow [N]; <br/> flow [u] [pre [u]-= rflow [N]; <br/>}< br/> maxflow ++ = rflow [N]; <br/>}< br/> int main () <br/>{< br/> // freopen ("in.txt", "r ", stdin); <br/> int U, V, W; <br/> scanf ("% d", & N, & P, & T ); <br/> L = inf; <br/> r =-INF; <br/> while (p --) <br/>{< br/> scanf ("% d", & U, & V, & W); <br/> If (W <L) L = W; <br/> If (W> r) r = W; <br/> E. push_back (edge (U, V, W); <br/>}< br/> while (L <= r) <br/>{< br/> mid = (R + l)/2; <br/> buildgraph (MID); <br/> ff (); <br/> If (maxflow> = T) <br/> r = mid-1; <br/> else l = Mid + 1; <br/>}< br/> printf ("% d/N", L); <br/> return 0; <br/>}