Created
August 5, 2017 18:06
-
-
Save snuke/60cb64cd07274541f114b4ace7bb767a to your computer and use it in GitHub Desktop.
TCO R3B Hard
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
rを根、LCA(h[a],h[b])=cとして、cを寝とする部分木をt、cの子を根とする部分木をt_i(1≦i≦子の数)とする。 | |
以下の新たな変数を置く。 | |
・Ta_i: h[a]が部分木t_iのどこかにある (単にTaならtのどこか) | |
・Tb_i: h[b]が部分木t_iのどこかにある(単にTbならtのどこか) | |
・Av: h[a]を頂点vに割り当てる | |
・Bv: h[b]を頂点vに割り当てる | |
条件節は以下の通り。*はbについても同様の条件節を作る。 | |
* Ta = true | |
・ ~Ta_i ∨ ~Tb_i | |
* ~Ta ∨ Ta_i | |
* ~Ta ∨ Ac | |
下の2式を葉まで再帰的にやると上手く機能する。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment