MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / tc

Function tc

HackerEarth_problems/New Friends/solution.cpp:123–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 ios_base::sync_with_stdio(false);
122 cin.tie(NULL);
123 tc(T)
124 {
125 int n,r;
126 cin>>n>>r;
127 vector<ii> edges(r+2);
128 for (int i = 0; i < r; ++i)
129 {
130 int x,y;
131 cin>>x>>y;
132 edges[i]={x,y};
133 }
134 int src,sink,k;
135 cin>>src>>sink>>k;
136 Dinic dc(n+2,src,sink);
137 for(int i=0;i<r;i++)
138 {
139 dc.add_edge(edges[i].ff,edges[i].ss,1);
140 }
141 if((k+1)<=dc.flow())
142 {
143 cout<<"YES\n";
144 }
145 else cout<<"NO\n";
146 }
147 return 0;
148}

Callers

nothing calls this directly

Calls 2

add_edgeMethod · 0.80
flowMethod · 0.80

Tested by

no test coverage detected