After round I saw some interesting links in the comments.
Problem F: After understanding that you must find "subset with maximum XOR" on range from L to R, this subtask is becoming very easy to google it (e.g https://www.geeksforgeeks.org/find-maximum-subset-xor-given-set/)
Actually the SAME problem: https://blog.csdn.net/ShadyPi/article/details/79939990
You can see many accepted submissions with this idea :|
Problem E: https://www.geeksforgeeks.org/assign-directions-to-edges-so-that-the-directed-graph-remains-acyclic/ the same idea to direct edges in order to topological sorting.
Thanks to Rinne and M_H_H_7 for the links in the comments (https://codeforces.com/blog/entry/64495?#comment-484476, https://codeforces.com/blog/entry/64495?#comment-484418).