Crossing River(1700poj)】的更多相关文章

Crossing River Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9919   Accepted: 3752 Description A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arra…
[题目描述] N个人过河,一次过去2个回来一个,给出每个人所需时间,问最小过河时间. [题目链接] http://noi.openjudge.cn/ch0406/702/ [算法] 一开始想样例是怎么成立的想了半天,因为一开始以为贪心策略就是最小的人陪每个人过去然后回来,这样子的话样例应该是19.样例:4个人,时间分别为:1 2 5 10.最少时间为17.策略是最小和次小先过去,然后最小回来,最大和次大过去,次小回来,然后最小次小再过去结束.然后按这种策略写wa了,没办法.查了一波题解,发现两种…
Description A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the boat back and forth so that all people may cross. Eac…
                                                                                                                           Crossing River Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 10311   Accepted: 3889 Description A group of N p…
题目描述: A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the boat back and forth so that all people may cross. Each pers…
[CTSC2008]祭祀river Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 2175  Solved: 1098[Submit][Status][Discuss] Description 在遥远的东方,有一个神秘的民族,自称Y族.他们世代居住在水面上,奉龙王为神.每逢重大庆典, Y族都 会在水面上举办盛大的祭祀活动.我们可以把Y族居住地水系看成一个由岔口和河道组成的网络.每条河道连接着 两个岔口,并且水在河道内按照一个固定的方向流动.显然,…
[CTSC2008]祭祀river Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 2175  Solved: 1098[Submit][Status][Discuss] Description 在遥远的东方,有一个神秘的民族,自称Y族.他们世代居住在水面上,奉龙王为神.每逢重大庆典, Y族都 会在水面上举办盛大的祭祀活动.我们可以把Y族居住地水系看成一个由岔口和河道组成的网络.每条河道连接着 两个岔口,并且水在河道内按照一个固定的方向流动.显然,…
题面: https://www.lydsy.com/JudgeOnline/problem.php?id=1143 一句话题意:给一个DAG(有向无环图),求选出尽量多的点使这些点两两不可达,输出点个数. N.M,分别表示点数和有向边数,n<=100,m<=1000. 题解: 第一眼看到题,发现是个DAG之后直接想到了dp,然后发现不可做. 然后仔细分析题目,发现就是在所有联通的点对(a,b)中两点不都被选中. 欸这不就是个最大独立集吗, 于是先floyd判连通性后跑hungary水过. 代码…
Description You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B), but there are several rivers you need to cross. Assume B is to the right of A, and all the rivers…
题意: 思路:这道题并没有官方题解 没有羊驼在所有三元组中出现就是NO 现在考虑不少于1只的情况 删去其中一只,我们得到了两组点和一些边 我们只要判断这是否为一张二分图,使用暴力染色的方法就有60分了 #include<cstdio> #include<algorithm> #define N 10010 #define M 50010 using namespace std; int T,n,m,edgenum,u,v,ok,isok,root; int f[N],vet[M],…