摘要:
You are given a tree (an acyclic undirected connected graph) withNnodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instructions... 阅读全文
摘要:
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits4and7. ... 阅读全文
摘要:
They say that Berland has exactly two problems, fools and roads. Besides, Berland hasncities, populated by the fools and connected by the roads. All B... 阅读全文
摘要:
As you know, an undirected connected graph withnnodes andn - 1edges is called atree. You are given an integerdand a tree consisting ofnnodes. Each nod... 阅读全文
摘要:
题意:给出一棵树,root=1,树有点权,有一个人叫做M有3种操作:1 u v 把u到v路径上的所有点的点权都给M2 u 若u的点权在M手上,拿走3 u 把u为根的子树的所有点权都给M每一个操作过后,输出M拥有的点权想法:要维护路径,用树链剖分要维护子树,用dfs序但是这样貌似要写很多然而后来知道树... 阅读全文
摘要:
一棵树,初始边权和点权都为0现在有m个操作,每一个操作:ADD1 u v k: for nodes on the path from u to v, the value of these nodes increase by k.ADD2 u v k: for edges on the path fr... 阅读全文
摘要:
Problem DescriptionOO has got a array A of size n ,defined a function f(l,r) represent the number of i (li) satisfy aimod aj=0,now OO want to know∑i=1... 阅读全文
摘要:
Ilya got tired of sports programming, left university and got a job in the subway. He was given the task to determine the escalator load factor.Let's ... 阅读全文
摘要:
nparticipants of the competition were split intomteams in some manner so that each team has at least one participant. After the competition each pair ... 阅读全文