题意: 给你n个点,第一个点一定是(0,0),最后一个点纵坐标yn一定是0,中间的点的横坐标一定都是在(0,xn)之间的 然后从第一个点开始飞行,每次飞到下一个点j,你花费的价值就是xi*yj-xj*yi,并且这里每一次飞行必须满足xi<xj 让你求出你所花费的最小的价值(可以为负)下,飞行的路径,如果有多种情况,输出路径字典序最小的那个 显然坐标相同的点里只保留编号最小的点最优.这里是因为题目严格要求xi<xj,所以不可能在原地飞行. 将起点到终点的路径补全为终点往下走到无穷远处,再往左走到…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6325                                   Interstellar Travel Problem Description After trying hard for many years, Little Q has finally received an astronaut license. To celebrate the fact, he intends to buy…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6331 Walking Plan  Problem Description There are n intersections in Bytetown, connected with m one way streets. Little Q likes sport walking very much, he plans to walk for q days. On the i -th day, Little…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322 Problem Description In number theory, Euler's totient function φ(n) counts the positive integers up to a given integer n that are relatively prime to n . It can be defined more formally as the number…
Chiaki often participates in international competitive programming contests. The time zone becomes a big problem.  Given a time in Beijing time (UTC +8), Chiaki would like to know the time in another time zone ss. Input There are multiple test cases.…
Little Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,...,n , connected by n−1 bidirectional edges. The i -th vertex has the value of wi .In this game, Little Q needs to grab some vertices on the tree. H…
hiaki has an array of nn positive integers. You are told some facts about the array: for every two elements aiai and ajaj in the subarray al..ral..r (l≤i<j≤rl≤i<j≤r), ai≠ajai≠aj holds.  Chiaki would like to find a lexicographically minimal array whi…
Chiaki has 3n3n points p1,p2,-,p3np1,p2,-,p3n. It is guaranteed that no three points are collinear.  Chiaki would like to construct nn disjoint triangles where each vertex comes from the 3n3n points. Input There are multiple test cases. The first lin…
Given an integer nn, Chiaki would like to find three positive integers xx, yy and zzsuch that: n=x+y+zn=x+y+z, x∣nx∣n, y∣ny∣n, z∣nz∣n and xyzxyz is maximum. Input There are multiple test cases. The first line of input contains an integer TT (1≤T≤1061…
题目传送门 题目大意: 给出n个平面坐标,保证第一个点和第n个点y值为0,其余点的x坐标都在中间,要从 i 点走到 j 点的要求是 i 点的横坐标严格小于 j 的横坐标,并且消耗的能量是(xi * yj - xj * yi),要求消耗的能量最小(能量可以为负),并且字典序要求最小. 思路: 消耗能量的式子就是两个坐标的叉积,叉积的几何意义就是两个向量对应的平行四边形的面积,但是这个面积会有正负,如果向量 j 在向量 i 的顺时针方向,则这个面积是负的,如果我希望能量最小,那么就尽可能使向量是顺时…