摘要:
有n项工作,每项分别在si开始,ti结束,对于每项工作一旦开始不能中途结束,参与的工作时间不能重叠,尽可能多的参加工作,求解最多项。应该在每次可以选择的工作中,选择出最早结束的那个工作进行。#include#include#define MAX 500using namespace std;int ... 阅读全文
posted @ 2015-04-18 15:45
Thereisnospon
阅读(141)
评论(0)
推荐(0)
摘要:
有1元,5元,10元,50元,100元,500元的硬币各c0,c1,c2,c3,c4, c5枚现在要使用这些硬币支付n元,问最少需要多少枚硬币,假设至少存在一种方案。应该尽可能使用500元的,然后再使用100元的.....使用贪心策略。#include "stdafx.h"#include#incl... 阅读全文
posted @ 2015-04-18 15:22
Thereisnospon
阅读(176)
评论(0)
推荐(0)
摘要:
#include "stdafx.h"#include#define MAX 500using namespace std;char imap[MAX][MAX];int n, m;void dfs(int x, int y){ imap[x][y] = '.'; for (int dx = -1;... 阅读全文
posted @ 2015-04-18 14:00
Thereisnospon
阅读(186)
评论(0)
推荐(0)
摘要:
#include "stdafx.h"#include#define MAX 100using namespace std;int n=7, k;int num[100] = { 1, 3, 4, 2, 5, 6, 7 };bool dfs(int i, int sum){ if (i == n)r... 阅读全文
posted @ 2015-04-18 13:58
Thereisnospon
阅读(158)
评论(0)
推荐(0)
摘要:
#include#include#include#include#define MAX 100using namespace std;const int INF = 10;typedef pairP;int d[MAX][MAX];char imap[MAX][MAX];int n, m;int ... 阅读全文
posted @ 2015-04-18 13:56
Thereisnospon
阅读(137)
评论(0)
推荐(0)

浙公网安备 33010602011771号