[COGS 2064]爬山】的更多相关文章

2064. 爬山 ★☆   输入文件:mountain.in   输出文件:mountain.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] 球有一天走在街上. 一个健身房发传单的人对球说:“来健身吗?还能减肥,挺好的!”. 球很不高兴.球一点都不觉得自己很胖,不过球还是决定去锻炼. 球最终选择了爬山. 球第一分钟位于海拔为a的地方.那之后,球每分钟可以向上爬不超过d米,也可以向下滚不超过d米,也可以原地不动(d米指的是竖直高度).球在第n分 钟时位于海拔为b的地…
#include <iostream> #include <cstring> #include <cstdio> using namespace std; namespace Dp{//状态转移 void shudp()/*"树Dp"*/{ cout<<"树Dp"<<endl;{ cout<<"hzoj:800 1040"<<' '<<"熟练…
http://www.cogs.top/cogs/problem/problem.php?pid=254 dist[i]表示能最早到达i点的时间.这样就可以用最短路模型来转移了. #include<queue> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 1003; const int K = 2003; int in()…
2064. Caterpillars Time limit: 3.0 secondMemory limit: 64 MB Young gardener didn’t visit his garden for a long time, and now it’s not very pleasant there: ncaterpillars have appeared on the ground. Kirill decided to use this opportunity to have some…
http://cojs.tk/cogs/problem/problem.php?pid=894 题意:n个点m条边的加权网络,求最少边数的按编号字典序最小的最小割.(n<=32, m<=1000) #include <bits/stdc++.h> using namespace std; typedef long long ll; struct Gr { static const int N=33, M=1005, oo=~0u>>1; struct E { int n…
http://cojs.tk/cogs/problem/problem.php?pid=147 学到新姿势了orz 这题求的是一条1-n的路径的最大路径最小. 当然是在k以外的. 我们可以转换一下. 求比某个价值大的某条路径的数量,只要小于k,那么这一定是一个可行解.因为其它的边都是小于了这个价值.(当然这里指的都是需要价格的) 我们在求这条路径时还要满足这条路径比这个价值大的边要最小,当然用最短路求. 那么问题就转换为,给定一个价值,求1-n的一条路径满足比这个价值大的边最少,而且少于k. 那…
http://cojs.tk/cogs/problem/problem.php?pid=710 近日开始刷水... 此题我为了练一下hash...但是hash跑得比暴力还慢.. 不言而喻... #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> #include…
http://cojs.tk/cogs/problem/problem.php?pid=896 我的计算几何入门题... 看了看白书的计算几何部分,,恩好嘛.. 乃们都用向量!!!! 干嘛非要将2个点确定一条线变成一个点从原点o出发的射线!!!! 这就是所谓的玩概念吗 然后用所谓的向量加减,是这些向量起点相同,然后就变成了原点o出发的射线!!! 然后你们还在玩概念!我跪了. (以上纯属蒟蒻吐槽) 好吧,计算几何非常有用的..简化了不少操作. 这里还有啥点积啥叉积.点积就是同一起点的向量(终点)的…
http://cojs.tk/cogs/problem/problem.php?pid=714 在hzwer的刷题记录上,默默地先跳过2题T_T...求凸包和期望的..T_T那是个啥..得好好学习 看到这题,. 太水了. 按价值排序后计算即可.(本来不想放题解的,但是为了满足下自己的虚荣心吧) #include <cstdio> #include <cstring> #include <cmath> #include <string> #include &l…
B - A Star not a Tree? Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88808#problem/B Description Luke wants to upgrade his home computer network from 10mbs to 100mbs. His existing network uses 10ba…