题目链接  CCPC2016 Changchun Problem E 题意  给定一个$n$个点$n$条边的无向图,现在从某一点$s$出发,每个点都经过一遍,最后在$t$点停止,经过的边数为$l$   求字典序最小的三元组$(l, s, t)$ 设环的长度为$c$, 当$s$和$t$在同一棵子树上的时候,$s$到$t$的路径上的边和环上的边只要走一次,其他边都要走两次,那么答案为$2n - c - len$ $len$为$s$到$t$的路径的长度: 当$s$和$t$不在同一棵子树上的时候,设$s…
Simple Function Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 111    Accepted Submission(s): 31 Problem Description Knowing that x can be any real number that x2 + Dx + E ≠ 0. Now, given the f…
背包九讲下载CSDN 背包九讲内容 多重背包: hdu 2191 珍惜现在,感恩生活 多重背包入门题 使用将多重背包转化为完全背包与01背包求解: 对于w*num>= V这时就是完全背包,完全背包为何只与01背包在循环上不同,因为01背包,每个物品只能取一次,所以要逆序:而完全背包,每个物品的数量无限多个,这就需要建在在之前已经取到了当前要取的基础之上: 同时01背包使用二进制优化处理:即使用二进制表示最优的可取值: 二进制优化的技巧:1,2,4,...,2k−1,n[i]−2k +1(循环之外…
夹角有多大II Problem Description 这次xhd面临的问题是这样的:在一个平面内有两个点,求两个点分别和原点的连线的夹角的大小.注:夹角的范围[0,180],两个点不会在圆心出现. Input 输入数据的第一行是一个数据T,表示有T组数据.每组数据有四个实数x1,y1,x2,y2分别表示两个点的坐标,这些实数的范围是[-10000,10000]. Output 对于每组输入数据,输出夹角的大小精确到小数点后两位. Sample Input 2 1 1 2 2 1 1 1 0 S…
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5203 bc(chinese):http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=575&pid=1002 题解: 不断的分类讨论下去 #include<algorithm> #include<iostream> #include<cstdio> using namespa…
http://acm.hdu.edu.cn/showproblem.php?pid=1533 Going Home Problem Description   On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. F…
2019 杭电多校 5 1004 题目链接:HDU 6627 比赛链接:2019 Multi-University Training Contest 5 Problem Description You are given two integers \(N,C\) and two integer sequences \(a\) and \(b\) of length \(N\). The sequences are indexed from \(1\) to \(N\). Please solve…
2019 杭电多校 8 1009 题目链接:HDU 6665 比赛链接:2019 Multi-University Training Contest 8 Problem Description Calabash is the servant of a landlord. The landlord owns a piece of land, which can be regarded as an infinite 2D plane. One day the landlord set up two…
不容易系列之一 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13566    Accepted Submission(s): 5660 Problem Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了!做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的…
又见GCD Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 18480    Accepted Submission(s): 7708 Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c.   Input 第一行输入一…