上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 60 下一页
摘要: 题目描述 一句话题意: 求一棵N-2条边权确定的树中那条不确定的边的边权分别为[L,R]中的每一个数时树中路径权值gcd为1的点对有多少。 (路径的gcd为所有边权的gcd) 题目描述 一句话题意: 求一棵N-2条边权确定的树中那条不确定的边的边权分别为[L,R]中的每一个数时树中路径权值gcd为1 阅读全文
posted @ 2018-02-13 10:49 蒟蒻JHY 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 发现列个方程就可以了: f(x)=1+ (not_div/tot)*f(x) + (1/tot) ∑f(x/div)=> (div/tot)*f(x)=1 + (1/tot) ∑f(x/div)=> f(x)=(tot/div) + (1/div) ∑f(x/div) 阅读全文
posted @ 2018-02-12 12:16 蒟蒻JHY 阅读(140) 评论(2) 推荐(0) 编辑
摘要: D - Black and White Tree Time limit : 2sec / Memory limit : 256MB Score : 900 points Problem Statement There is a tree with N vertices numbered 1 thro 阅读全文
posted @ 2018-02-11 10:54 蒟蒻JHY 阅读(356) 评论(1) 推荐(0) 编辑
摘要: Discription You are given an undirected graph consisting of n vertices and edges. Instead of giving you the edges that exist in the graph, we give you 阅读全文
posted @ 2018-02-07 11:04 蒟蒻JHY 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 题目描述 小强要在NN 个孤立的星球上建立起一套通信系统。这套通信系统就是连接NN 个点的一个树。 这个树的边是一条一条添加上去的。在某个时刻,一条边的负载就是它所在的当前能够 联通的树上路过它的简单路径的数量。 现在,你的任务就是随着边的添加,动态的回答小强对于某些边的负载的 询问。 输入输出格式 阅读全文
posted @ 2018-02-07 09:53 蒟蒻JHY 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 题目背景 xht喜欢研究数学函数,他特别喜欢反比例函数。 题目描述 我们知道,反比例函数xy=a的图象是双曲线。 xht于是想:把它推广到三维是什么样的呢? 定义曲面C(k)为方程xyz=k所确定的曲面。 又定义曲面的美观程度P(k)为曲面C(k)上所有整点(x,y,z坐标均为整数)到原点的曼哈顿距 阅读全文
posted @ 2018-02-07 08:58 蒟蒻JHY 阅读(390) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Let's denote a function You are given an array aa consisting of nn integers. You have to calculate the sum of d(a_{i},a_{j})d(ai​,aj​) over all p 阅读全文
posted @ 2018-02-06 15:48 蒟蒻JHY 阅读(277) 评论(0) 推荐(0) 编辑
摘要: Discipntion Let's call an array a of size n coprime iff gcd(a1, a2, ..., an) = 1, where gcd is the greatest common divisor of the arguments. You are g 阅读全文
posted @ 2018-02-06 11:10 蒟蒻JHY 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Discription The Travelling Salesman spends a lot of time travelling so he tends to get bored. To pass time, he likes to perform operations on numbers. 阅读全文
posted @ 2018-02-05 21:14 蒟蒻JHY 阅读(465) 评论(0) 推荐(0) 编辑
摘要: vjudge上的UVA题面都不好复制。。。 首先可以发现,每次操作可以从任意堆取一颗石子(除了最后一堆),然后把这颗石子变成两个然后放到这堆后面的任意两堆里去。 而且每次操作最多可以取一个石子。 这样我们就把每个石子看成一个子游戏,位置在i的堆的每个石子看成一个石子数为n-i的堆。 然后再搞一搞sg 阅读全文
posted @ 2018-02-05 20:25 蒟蒻JHY 阅读(270) 评论(0) 推荐(0) 编辑
上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 60 下一页