This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int MaximumFlow(const graph& g, int s, int t) | |
| { | |
| //maximum flow == return value | |
| int maxflow = 0; | |
| //res is Residual graph | |
| vector<vector<int>> res(g.flow.begin(), g.flow.end()); | |
| //parent present where from | |
| vector<int> parent(g.V, -1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| using namespace std; | |
| int main(int argc, char * argv[]) | |
| { | |
| int test; cin >> test; | |
| while(test--) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <fstream> | |
| using namespace std; | |
| int main(int argc, char * argv[]) | |
| { | |
| ifstream in("self_introduce_number.in"); | |
| ofstream out("self_introduce_number.out"); | |
| int test; in >> test; | |
| //int test; cin >> test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // convex_hull.h | |
| // DailyCodingTeamNote | |
| // | |
| // Created by MaybeS on 10/3/15. | |
| // Copyright (c) 2015 Maybe. All rights reserved. | |
| // | |
| #pragma warning (disable :4996) | |
| #pragma once | |
| #include <utility> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // BIT.h | |
| // | |
| // binary indexed tree | |
| // | |
| // INPUT: tree | |
| // | |
| // OUTPUT: query | |
| // | |
| // Time: O(log(2N)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // rREF.h | |
| // | |
| // Reduced row echelon form via Gauss-Jordan elimination | |
| // with partial pivoting. | |
| // | |
| // INPUT: vector<vector<T>> nxm matrix | |
| // | |
| // OUTPUT: rank | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // topologicalSort.h | |
| // | |
| // TopologicalSort | |
| // | |
| // INPUT: vector | |
| // | |
| // OUTPUT: if directed acycilc graph return DAG; | |
| // | |
| // Time: theta(n+m) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // trie.h | |
| // | |
| // trie struct for string search | |
| // | |
| // INPUT: vector<string> (keys) | |
| // | |
| // OUTPUT: if string in keys | |
| // | |
| // Time: O(M) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // kruskal.h | |
| // | |
| // kruskal algorithm by greedy | |
| // | |
| // INPUT: vector (directed, weighted graph) | |
| // | |
| // OUTPUT: minimum spanning tree | |
| // | |
| // Time: O(ElogV) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //INF Should not interfere Process | |
| #define SEG_INF 0 | |
| #include <vector> | |
| #include <iterator> | |
| #include <algorithm> | |
| #include <functional> | |
| using namespace std; |