Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[問題案] Vertex Add Path Sum (vertex_add_path_sum) #125

Closed
yosupo06 opened this issue Oct 4, 2019 · 5 comments · Fixed by #247
Closed

[問題案] Vertex Add Path Sum (vertex_add_path_sum) #125

yosupo06 opened this issue Oct 4, 2019 · 5 comments · Fixed by #247
Assignees

Comments

@yosupo06
Copy link
Owner

yosupo06 commented Oct 4, 2019

問題概要

木が与えられる。

  • 0 p x: a_p += x
  • 1 u v: u, v間のパス(両端含む)のaのsum

入力

N Q
a_0 a_1 ... a_{N - 1}
u_0 v_0
u_1 v_1
:
u_{N - 2} v_{N - 2}
Query0
Query1
:
Query_{Q - 1}

出力

制約

  • 1 <= N <= 200,000
@yosupo06 yosupo06 changed the title [問題案] Point Add Path Sum (point_add_path_sum) [問題案] Vertex Add Path Sum (vertex_add_path_sum) Oct 16, 2019
@yosupo06 yosupo06 self-assigned this Oct 17, 2019
@yosupo06
Copy link
Owner Author

yosupo06 commented Oct 17, 2019

辺と数列swapした方がいいな→しました→そうでもないな(頂点 -> 辺の順の方が自然な為)

@yosupo06
Copy link
Owner Author

うっかりmasterにpushしたけど

@yosupo06
Copy link
Owner Author

ジェネレーターが配列外アクセスしてる

@ryuhei-mori
Copy link

問題文で N,Q ≤ 200,000 となっていますが、実際には 500,000 がテストケースにおける N と Q の最大値のようです。

@yosupo06
Copy link
Owner Author

yosupo06 commented Jan 5, 2020

わ、本当ですね ありがとうございます

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants