
UVA
Sureina
空太はバカ
展开
-
UVA 514 - Rails
Description There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It wa原创 2016-07-28 11:51:53 · 238 阅读 · 0 评论 -
UVA 11988 - Broken Keyboard (a.k.a. Beiju Text)
Description You're typing a long text with a broken keyboard. Well it's not so badly broken. The only problem with the keyboard is that sometimes the "home" key or the "end" key gets automat原创 2016-07-28 12:30:52 · 322 阅读 · 0 评论 -
UVA 536 - Tree Recovery
Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes. This is an example of one of her crea原创 2016-07-30 09:56:45 · 570 阅读 · 0 评论 -
UVA 679 - Drooping Balls
A number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, either foll原创 2016-07-30 10:02:46 · 291 阅读 · 0 评论 -
UVA 839 - Not so Mobile
题意:有许多天秤,判断是否为平衡状态。 其实就是二叉树,使用一边的长度乘以重量,再和另一边的比较,如果有一边是0,那么它的下面肯定还有一个秤。 本来用建树再操作写的自己都晕了,后来在网上看到直接用递归输入处理的【膜拜】 #include int flag; int Mobile() { int Wl, Dl, Wr, Dr; scanf("%d%d%d%d", &Wl,原创 2016-07-30 10:08:20 · 364 阅读 · 0 评论 -
UVA 10585 - Center of Symmetry
Description Given is a set of n points with integer coordinates. Your task is to decide whether the set has a center of symmetry. A set of points S has the center of symmetry if there exists a原创 2016-09-03 09:19:24 · 506 阅读 · 0 评论 -
UVA 11426 - GCD Extreme(II)
题意:求sum(gcd(i,j),1 1.建立递推关系,s(n)=s(n-1)+gcd(1,n)+gcd(2,n)+……+gcd(n-1,n); 2.设f(n)=gcd(1,n)+gcd(2,n)+……+gcd(n-1,n)。 gcd(x,n)=i是n的约数(x 而gcd(x,n)=i等价于gcd(x/i,n/i)=1,因此g(n,i)等价于phi(n/i).phi(x)为欧拉函数。原创 2016-11-22 16:43:12 · 392 阅读 · 0 评论