题意: 给你一个n个点m条边的图,对于第i条边,它的长度是2i,对于每一个顶点,它不是0类型,就是1类型.你需要找出来对于所有的"两个不同类型的点之间最短距离"的和 题解(参考:https://blog.csdn.net/wayne_lee_lwc/article/details/107851431): 因为20+21+22<23,即20+21+...+2n-1<2n 所以如果第i条边连接的两个点已经联通,我们就不需要用这条边.所以这里用并查集判断下 后面我们用 sum,以…
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Description On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored. Currently the ball stands still at p…
An Easy Physics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3845    Accepted Submission(s): 768 Problem Description On an infinite smooth table, there's a big round fixed cylinder an…
An Easy Physics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1430    Accepted Submission(s): 270 Problem Description On an infinite smooth table, there's a big round fixed cylinder an…
UVA11069 - A Graph Problem(DP) 题目链接 题目大意:给你n个点.要你找出有多少子串符合要求.首先没有连续的数字,其次不能再往里面加入不论什么的数字而不违反第一条要求. 解题思路:要发现每一个数字选定后.之后能够有两种选择.所以f(n) = f(n + 2) + f(n + 3):边界:当无法往下加入数字的时候那么返回1. 代码: #include <cstdio> #include <cstring> const int maxn = 100; int…
Flow Problem HDU - 3549 Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph.  InputThe first line of input contains an integer T, denoting the number of t…
D - Ugly Problem HDU - 5920 Everyone hates ugly problems. You are given a positive integer. You must represent that number by sum of palindromic numbers. A palindromic number is a positive integer such that if you write out that integer as a string i…
Prime Ring Problem HDU - 1016 A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number of first circle should a…
2015上海区域赛现场赛第5题. 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5572 题意:在平面上,已知圆(O, R),点B.A(均在圆外),向量V. 一个小球从A出发,沿速度向量V匀速前进,若撞到圆则发生弹性碰撞,沿“反射方向”继续匀速前进.问A点能否经过B点. 题目读懂了,把所有情况都考虑全,流程图就出来了,然后直接套模版即可(注意有些功能可剪裁~) 我的第一道计算几何,WA了一个星期啊...原因有姿势不对,精度不对,还有输出不对的. 不…
[题目概述] On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored. Currently the ball stands still at point A, then we'll give it an initial speed and a direction. If the ball hits the cylinder, it w…