题目链接:http://poj.org/problem?id=1564给出m个数,求出和为n的组合方式;并按从大到小的顺序输出;简单的dfs但是看了代码才会;#include #include #include #include using namespace std;int n, m, flag;... Read More
题目链接:http://lightoj.com/volume_showproblem.php?problem=1094Given a tree (a connected graph with no cycles), you have to find the farthest nodes in the... Read More
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1260题意就是有n个人排队买票,每个人需要的时间是a[i] (1=#include#include#includeusing namespace std;#define N 2200#define INF... Read More
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1532题意:每次下雨的时候,农场主John的农场里就会形成一个池塘,这样就会淹没其中一小块土地,在这块土地上种植了Bessie最喜欢的苜蓿。这意味着苜蓿要被水淹没一段时间,而后要花很长时间才能重新长出来。... Read More
Description<!--Converted with LaTeX2HTML 98.1 release (February 19th, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Le Read More
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2236要求最大值与最小值的差值最小,是通过枚举边的下限和上限来完成只需要用二分找一个区间,然后不断枚举这个区间是否可以达到最大匹配,一直二分到答案为止。#include#include#include#i... Read More