| 1 | struct node { |
| 2 | node *p, *jmp[20]; |
| 3 | int depth; |
| 4 | node(node *_p = NULL) : p(_p) { |
| 5 | depth = p ? 1 + p->depth : 0; |
| 6 | memset(jmp, 0, sizeof(jmp)); |
| 7 | jmp[0] = p; |
| 8 | for (int i = 1; (1<<i) <= depth; i++) |
| 9 | jmp[i] = jmp[i-1]->jmp[i-1]; } }; |
| 10 | node* st[100000]; |
| 11 | node* lca(node *a, node *b) { |
| 12 | if (!a || !b) return NULL; |
nothing calls this directly
no outgoing calls
no test coverage detected