election_campaign.cpp: In function 'int lca(int, int)':
election_campaign.cpp:38:9: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^
election_campaign.cpp: At global scope:
election_campaign.cpp:52:2: error: expected ';' after struct definition
}
^
;
election_campaign.cpp: In function 'void dfs2(int, int)':
election_campaign.cpp:71:22: error: 'seg' was not declared in this scope
for(auto nxt : chd) seg.update(1, 1, N, L[nxt], R[nxt], -dp[nxt]);
^~~
election_campaign.cpp:74:9: error: 'seg' was not declared in this scope
int v=seg.query(1, 1, N, L[it.u])+seg.query(1, 1, N, L[it.v])+sum+it.w;
^~~
election_campaign.cpp:77:2: error: 'seg' was not declared in this scope
seg.update(1, 1, N, L[now], R[now], sum);
^~~
election_campaign.cpp:57:6: warning: unused variable 'i' [-Wunused-variable]
int i, j;
^
election_campaign.cpp:57:9: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^
election_campaign.cpp: In function 'int main()':
election_campaign.cpp:84:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &N);
~~~~~^~~~~~~~~~
election_campaign.cpp:88:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &u, &v);
~~~~~^~~~~~~~~~~~~~~~
election_campaign.cpp:96:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &Q);
~~~~~^~~~~~~~~~
election_campaign.cpp:100:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &u, &v, &k);
~~~~~^~~~~~~~~~~~~~~~~~~~~~