diff options
| author | Paul Jungeblut <paul.jungeblut@gmail.com> | 2017-05-04 16:22:27 +0200 |
|---|---|---|
| committer | Paul Jungeblut <paul.jungeblut@gmail.com> | 2017-05-04 16:22:27 +0200 |
| commit | 92f02961b71c82c91d2968c0b1f392c89d0dc57f (patch) | |
| tree | 900b037ce90f2137bdef7e38b48c72b6860ce3ed /datastructures | |
| parent | 8d5f3c5a9b10a5198fa2db0d298c843dd66c3719 (diff) | |
Adding fast Input/Output and Manacher's algorithm.
Diffstat (limited to 'datastructures')
| -rw-r--r-- | datastructures/segmentTree.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/datastructures/segmentTree.cpp b/datastructures/segmentTree.cpp index 3905151..c810af7 100644 --- a/datastructures/segmentTree.cpp +++ b/datastructures/segmentTree.cpp @@ -2,6 +2,8 @@ // Berechnet das Maximum im Array. int a[MAX_N], m[4 * MAX_N]; +int gcd(int a, int b) { return b == 0 ? a : gcd (b, a % b); } + int query(int x, int y, int k = 0, int X = 0, int Y = MAX_N - 1) { if (x <= X && Y <= y) return m[k]; if (y < X || Y < x) return -INF; // Ein "neutrales" Element. |
