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"segment_tree.cpp" | |
| #include"map" | |
| #include"algorithm" | |
| #include"stdio.h" | |
| using namespace std; | |
| #define REP(i,n) for(int i=0;i<n;i++) | |
| struct query{char op[2]; int x;}; | |
| struct node{ | |
| int num_active_leaves; | |
| void merge(node& a, node& b){ |
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"cassert" | |
| #include"vector" | |
| typedef unsigned int I32; | |
| typedef I32* P32; | |
| template <typename T, int beginidx=0> // in case vertices of graph are like 1, 2, 3 ..., beginidx becomes 1 | |
| class LCA { | |
| P32 height, pathno, head, ancestor, log; | |
| std::vector<I32>* paths; | |
| const I32 ulim, root; | |
| const T* const G; |
OlderNewer