摘要:
题目描述 摩尔瓦多的移动电话公司摩基亚(Mokia)设计出了一种新的用户定位系统。和其他的定位系统一样,它能够迅速回答任何形如“用户C的位置在哪?”的问题,精确到毫米。但其真正高科技之处在于,它能够回答形如“给定区域内有多少名用户?”的问题。 在定位系统中,世界被认为是一个W×W的正方形区域,由1× 阅读全文
摘要:
Discription Problem statement is simple. Given A and B you need to calculate S(A,B) . Here, f(n)=n, if n is square free otherwise 0. Also f(1)=1. Inpu 阅读全文
摘要:
Discription 有一棵以1为根的树,他有n个结点,用1到n编号。第i号点有一个值vi。 现在可以对树进行如下操作: 步骤1:在树中选一个连通块,这个连通块必须包含1这个结点。 步骤2:然后对这个连通块中所有结点的值加1或者减1。 问最少要经过几次操作才能把树中所有结点都变成0。 注意:步骤1 阅读全文
摘要:
Discription 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 f 阅读全文
摘要:
Discription Ostap already settled down in Rio de Janiero suburb and started to grow a tree in his garden. Recall that a tree is a connected undirected 阅读全文