题意: http://acm.hdu.edu.cn/showproblem.php?pid=3966 给一棵树,并给定各个点权的值,然后有3种操作: I x y z : 把x到y的路径上的所有点权值加上z D x y z:把x到y的路径上的所有点权值减去z Q z:查询节点编号为x的权值 这里主要放下用树状数组维护的模板 区间修改单点查询 好像用线段树更好? em.... 两种都放好了~ 好像说hduoj是windows系统容易爆栈 手动扩栈加这句 #pragma comment(linker,…
题意: 一棵树, 操作1.$path(a,b)$之间的点权$+k$ 操作2.单点查询 题解: 树链剖分即可,注意代码细节,双向映射 主要是记录一下板子 #include <string.h> #include <stdio.h> #include <algorithm> #define endl '\n' #define ll long long #define ull unsigned long long #define fi first #define se sec…
Aragorn's Story Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13587 Accepted Submission(s): 3623 Problem Description Our protagonist is the handsome human prince Aragorn comes from The Lor…
List wants to travel Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 429 Accepted Submission(s): 92 Problem Description A boy named List who is perfect in English. Now he wants to travel an…
Yaoge’s maximum profit Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 982 Accepted Submission(s): 274 Problem Description Yaoge likes to eat chicken chops late at night. Yaoge has eaten too…
Little Devil I Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 894 Accepted Submission(s): 296 Problem Description There is an old country and the king fell in love with a devil. The devil…
Dylans loves tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1484 Accepted Submission(s): 347 Problem Description Dylans is given a tree with N nodes. All nodes have a value A[i].Nodes…