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
| import java.util.ArrayList; | |
| import java.util.Random; | |
| public class Test { | |
| /* | |
| * Implementation of the Fisher–Yates shuffle algorithm with O(N) time complexity | |
| */ | |
| public static <T> void shuffle(ArrayList<T> items) | |
| { | |
| if(items == null) throw new NullPointerException(); | |
| Random numberGenerator = new Random(); |
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
| //Complexity for each case: O(N^2 * logN) | |
| #include <iostream> | |
| #include <utility> | |
| #include <vector> | |
| #include <algorithm> | |
| using namespace std; | |
| typedef pair<int, int> ii; | |
| const int MAXN = 1000; | |
| int N, K; | |
| int atWhichPosMin[MAXN]; |
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 <string> | |
| #include <utility> | |
| #include <queue> | |
| #include <algorithm> | |
| #include <cstring> | |
| using namespace std; | |
| typedef pair<int, int > ii; | |
| struct Edge { |
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 <cstring> | |
| #include <string> | |
| #include <algorithm> | |
| #include <queue> | |
| #include <cstdio> | |
| #include <stack> | |
| #include <utility> | |
| #include <fstream> |
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 <cstring> | |
| #include <string> | |
| #include <algorithm> | |
| #include <queue> | |
| #include <cstdio> | |
| #include <stack> | |
| #include <utility> | |
| 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 <vector> | |
| #include <cstring> | |
| #include <string> | |
| #include <algorithm> | |
| #include <queue> | |
| #include <cstdio> | |
| #include <utility> | |
| using namespace std; | |
| int 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
| #include <iostream> | |
| #include <vector> | |
| #include <cstring> | |
| #include <string> | |
| #include <algorithm> | |
| #include <queue> | |
| #include <cstdio> | |
| #include <utility> | |
| using namespace std; | |
| const int TABLE_SIZE = 10000; |
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 <cstring> | |
| #include <algorithm> | |
| using namespace std; | |
| typedef long long int i64; | |
| void read() | |
| { | |
| int A, B, C; | |
| i64 matrix[30][30][30]; | |
| i64 maxSum = -(1LL << 60); |
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 <iomanip> | |
| #include <algorithm> | |
| using namespace std; | |
| const double EPS = 1e-10; | |
| double f(double d, int m, int v, double i) | |
| { | |
| double loanLeft = v; | |
| for(int j = 0; j < m; ++j) | |
| { |
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> | |
| #include <cstdlib> | |
| using namespace std; | |
| struct IntervalTree | |
| { | |
| vector<int> data, tree; | |
| int N; |
NewerOlder