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 <cstdio> | |
| #include <algorithm> | |
| #define MAXS 100 | |
| #define MAXARR 1000000 | |
| int leftElem[MAXARR + 1], rightElem[MAXARR + 1]; | |
| int il; | |
| int binarysearch(int value, int arr[], int arrlen) { |
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
| /* | |
| easy "dp" | |
| */ | |
| #include <iostream> | |
| #include <cstdio> | |
| using namespace std; | |
| int main() | |
| { |
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
| // hsin.hr/coci -> all credits | |
| /* | |
| Dijkstra, by using idea that | |
| number of times path i->j will be reached is = (number of different paths to i) * (number of nodes that you can reach from j) | |
| */ | |
| #include <cstdio> | |
| #include <set> |
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
| /* | |
| dijkstra + custom heap + binary search for city | |
| */ | |
| #include <iostream> | |
| #include <cstdio> | |
| #include <vector> | |
| #include <algorithm> | |
| using namespace std; |
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
| /* | |
| recursion | |
| */ | |
| #include <iostream> | |
| #include <cstdio> | |
| #include <fstream> | |
| using namespace std; | |
| string sol; |
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
| /* | |
| Dijkstra | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| #include <cstdio> | |
| #include <set> | |
| using namespace std; |
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
| /* | |
| shortest path (brute force, almost checks all possible combinations) | |
| */ | |
| #include <iostream> | |
| #include <cstdio> | |
| #include <cstring> | |
| using namespace std; |
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
| /* | |
| easy dijkstra | |
| */ | |
| #include <iostream> | |
| #include <cstdio> | |
| #include <vector> | |
| #include <set> | |
| using namespace std; |
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 <cstdio> | |
| #include <vector> | |
| #include <set> | |
| #include <map> | |
| using namespace std; | |
| const int inf = (1 << 29); |
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 <cstdio> | |
| #include <vector> | |
| #include <set> | |
| #include <cmath> | |
| using namespace std; | |
| const int inf = (1 << 29); | |
| vector < vector < pair < int, int > > > graph; |
NewerOlder