election.cpp: In function 'Tree Calc(int, int, int, int, int)':
election.cpp:29:20: error: cannot bind non-const lvalue reference of type 'Tree&' to an rvalue of type 'Tree'
return Merge(Calc(nd * 2, b, m, s, min(m, l)), Calc(nd * 2 + 1, m + 1, e, max(m + 1, s), l));
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
election.cpp:12:6: note: initializing argument 1 of 'Tree Merge(Tree&, Tree&)'
Tree Merge(Tree &a, Tree &b) {
^~~~~
election.cpp: In function 'int main()':
election.cpp:37:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
election.cpp:38:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%s", p + 1);
~~~~~^~~~~~~~~~~~~
election.cpp:44:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &Q);
~~~~~^~~~~~~~~~
election.cpp:47:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &b, &e);
~~~~~^~~~~~~~~~~~~~~~