自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(82)
  • 资源 (2)
  • 收藏
  • 关注

原创 无优先级运算问题

#include <iostream>#include <fstream>using namespace std;const int MAX = 50;int num[MAX]; //输入的数int flag[MAX]; //是否已经用过int oper[MAX]; //1--'+', 2--'-', 3--'*', 4--'/'int n, m; int p[MAX]; //

2015-11-30 21:55:57 5680 4

原创 最佳调度问题

#include <iostream>#include <fstream>using namespace std;const int MAX = 50;int time[MAX]; //完成任务需要时间 int n, k;int best = 1000000;int p[MAX]; //机器void compute(){ int max = p[1]; for(in

2015-11-30 19:38:30 1147

原创 布线问题

#include <iostream>#include <fstream>#include <cmath>#include <algorithm>using namespace std;int conn[21][21];int n;int p[21];int bestp[21];int min = 100000;int cur;void compute(){ cur =

2015-11-30 19:03:43 392

原创 智力拼图问题

#include <iostream>#include <fstream>using namespace std;int brow, bcol; //brow * bcol 的矩形class dom{public: int aa[5][5]; //存储给定的每个图形 dom() { for(int i=0; i<5; i++)

2015-11-30 16:46:05 1540

原创 独立钻石跳棋问题

//参考 :http://blog.sina.com.cn/s/blog_510ad0640100bo3d.html#include <iostream>#include <fstream>using namespace std;struct step //记录移动棋子的信息{ int sx, sy; // 记录移动棋子前棋子的位置 int tx, ty; // 记录移动棋子后

2015-11-30 11:47:32 1362

原创 工作分配问题

#include<iostream>#include<fstream>using namespace std;const int MAX = 50;int n, m, k;int p[MAX][MAX]; int min = 1000000; //最小总费用int cur = 0; //目前费用int r[MAX]; void compute(){ for(int

2015-11-28 21:29:05 581

原创 罗密欧与朱丽叶迷宫问题

#include<iostream>#include<fstream>using namespace std;const int MAX = 10;int n, m, k;int board[MAX][MAX];int best[MAX][MAX];int dirs = 0; //转弯次数int min = 100000; //最少转弯次数int count = 0; //不

2015-11-28 20:59:13 7764 1

原创 重复拉丁矩阵

#include<iostream>#include<fstream>#include<algorithm>using namespace std;const int MAX = 50;int n, m, k;int times[MAX]; //每种宝石的重复次数int id[MAX]; //每个宝石的价值序号int board[MAX][MAX]; //宝石矩阵//考察当前列宝

2015-11-28 18:52:04 1548 2

原创 排列宝石问题

#include<iostream>#include<fstream>#include<algorithm>using namespace std;const int MAX = 50;int n;bool board[MAX][MAX]; //board[i][j]记录形状为i,颜色为j的宝石是否已使用过int a[MAX][MAX]; //存储宝石形状矩阵int b[MAX][

2015-11-27 21:42:48 1458

原创 拉丁矩阵问题

#include<iostream>#include<fstream>#include<algorithm>using namespace std;const int MAX = 50;int n, m;int board[MAX][MAX];//考察当前列是否有相同形状的宝石bool ok(int r, int c, int k){ for(int i=1; i<r; i++

2015-11-27 21:01:55 2563 2

原创 无和集问题

#include<iostream>#include<fstream>#include<algorithm>#include "ctime"using namespace std;const int MAXN = 10;const int MAX = 100;int n;int sum[MAXN][MAX];bool s[MAXN][MAX];int t[MAX];int bes

2015-11-27 20:21:40 2922 1

原创 整数变换问题

#include<iostream>#include<fstream>#include<algorithm>using namespace std;const int MAX = 50;int n, m;int x[MAX];int bestx[MAX];int f(int i, int n){ if(i==1) return n*3; else

2015-11-27 20:20:12 2579 2

原创 n色方柱问题

#include<iostream>#include<fstream>#include<algorithm>using namespace std;const int MAX = 50;int board[MAX][6]; //存储n个立方体各面的颜色int solu[MAX][6]; //存储解int n; //立方体个数、颜色种数int ans = 0; //解的个数i

2015-11-26 21:01:13 5733 6

原创 无分隔符字典问题

#include <iostream>#include <fstream>#include <algorithm>#include <vector>#include <set>#include "cstdlib"using namespace std;int *ak;int lk;int n, k; int best = 0; //最大无分隔符字典元素个数vector<int> L

2015-11-26 10:46:58 2391 2

原创 运动员最佳匹配问题

#include <iostream>#include <fstream>using namespace std;const int INF = 100000;const int MAX = 50;int p[MAX][MAX];int q[MAX][MAX];int x[MAX];int n; //男女运动员人数int bestw = 0;int cw = 0;void comp

2015-11-25 17:51:40 1604

原创 最小重量机器设计问题

#include <iostream>#include <fstream>using namespace std;const int INF = 100000;const int MAX = 50;int c[MAX][MAX];int w[MAX][MAX];int bestx[MAX];int x[MAX];int n, m, d; //部件个数,供应商数,最大总价格int c

2015-11-25 17:33:01 468

原创 最小长度电路板排列问题

#include <iostream>#include <fstream>using namespace std;const int INF = 100000;const int MAX = 50;int p[MAX][MAX];int bestx[MAX];int x[MAX];int minLen = INF;int n, m; //电路板数,连接块数int low[MAX];

2015-11-25 16:30:33 1766 2

原创 子集和问题

#include <iostream>#include <fstream>#include <algorithm>#include <queue>using namespace std;const int MAX = 50;int a[MAX];int x[MAX];int bestx[MAX];int bestw = 0;int cw = 0;int r = 0;bool ba

2015-11-25 15:24:00 471

原创 多元Huffman编码变形

#include <iostream>#include <fstream>#include <algorithm>#include <queue>using namespace std;/*首先找到向量y,使y = max{ y<=m| y(2)*1 + y(3)*2 + ... + y(n)*(n-1) = n-1 }。如果找不到,则问题无解,否则用向量y作贪心计算贪心策略:每次选最

2015-11-25 14:40:44 766

原创 任务时间表问题

for(i=0; i<n; i++) { fin >> task[i].d >> task[i].w; cout << task[i].d << " " << task[i].w << endl; }

2015-11-25 11:25:34 1450 1

原创 区间相交问题

#include <iostream>#include <fstream>#include <algorithm>using namespace std;/*与活动安排问题类似,每次选取右端点坐标最小的闭区间,保留该闭区间,并将与其相交的闭区间删除*/

2015-11-25 10:24:41 474

原创 多元Huffman编码问题

#include <iostream>#include <fstream>#include <algorithm>#include <queue>using namespace std;/*每次选最小的k个元素进行合并。与2元Huffman算法类似*/

2015-11-25 09:46:35 5863 1

原创 非单位时间任务安排问题

#include <iostream>#include <fstream>#include <algorithm>using namespace std;/*首先将任务按其截止时间非减序排序p(i, d)表示对任务1,2..i,截止时间为d的最小误时惩罚p(i, d) = min{ p(i-1, d)+wi, p(i-1, min{d, di}-ti) }p(1, d) = 0 t

2015-11-24 21:14:30 4539 12

原创 磁带利用率问题

#include <iostream>#include <fstream>#include <algorithm>using namespace std;/*最短程序优先。求得最多可以存储的程序个数count后,再求最大利用率,问题转换为装载问题,但count已知。 */const int MAX = 50;int f[MAX];int r = 0; //剩余程序长度和int l

2015-11-24 15:25:59 856 1

原创 套汇问题

#include <iostream>#include <fstream>#include <string>using namespace std;const int MAX = 10;string name[MAX];double r[MAX][MAX]; //r[i][j]表示货币i与货币j的兑换率double max(double a, double b){ return

2015-11-24 11:26:56 1618

原创 嵌套箱问题

//参考:http://wenku.baidu.com/link?url=pfD9FxgHfr7uyJcphmGhGDbgNjbEbBT51sfC8Y2sXckQE2j54I9xMGLGSro_c4fZ62xKjbifLH16DBmoQeXeBz_nW3jJC-gJxhL-rgdYy97#include <iostream>#include <fstream>#include <queue>u

2015-11-24 10:44:14 888

原创 数列极差问题

#include <iostream>#include <fstream>#include <queue>using namespace std;//类似Huffmanint max(int *a, int n){ priority_queue<int> q; int i; for(i=0; i<n; i++) q.push(a[i]); i

2015-11-23 21:11:30 912

原创 删数问题

#include <iostream>#include <fstream>#include <string>using namespace std;//最近下降点优先//返回a删除k个数字后的最小数string delek(string a, int k){ int i; int len = a.length(); int count = 0; while

2015-11-23 20:53:04 396

原创 硬币找钱问题2

//参考 http://www.cppblog.com/cuijiaxing/archive/2012/04/15/171448.aspx #include <iostream> #include <fstream> using namespace std; ifstream ifs; int coins[6];//各面值硬币数 int count = 0;//需要的最少硬币数

2015-11-23 20:32:02 1105 2

原创 硬币找钱问题1

#include "iostream"#include "fstream"using namespace std;/*最大面值优先*/int coins[6];int greedy(double money){ cout << "找钱时用到的钱币有:"; int m[] = {200, 100, 50, 20, 10, 5}; //硬币面值,单位为分 money

2015-11-23 14:53:56 785

原创 区间覆盖问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*每次覆盖尽可能多的点*/int x[50];int greedy(int n, int k){ sort(x, x+n); //将各点坐标排序 int i = 1; int dist = 0; int d;

2015-11-23 14:01:52 502

原创 汽车加油问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*最远加油站优先*/int s[50];int greedy(int n, int k){ int i; int sum = 0; int count = 0; for(i=0; i<=k; i++) {

2015-11-23 12:33:07 910

原创 d森林问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*最短服务时间优先*/const int MAX = 50;int parent[MAX]; //存储父结点int leaf[MAX]; //存储叶子结点int deg[MAX]; //存储顶点的出度int parlen[MAX]

2015-11-23 12:10:05 5427 5

原创 多处最优服务次序问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*最短服务时间优先*/double t[50];//返回最小平均等待时间double greedy(int n, int s){ sort(t, t+n); //按服务时间排序 double *sum = new doub

2015-11-23 10:09:03 1510 1

原创 最优服务次序问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*最短服务时间优先 */double t[50];//返回最小平均等待时间double greedy(int n){ sort(t, t+n); //按服务时间排序 int i; double sum = 0;

2015-11-23 09:49:17 624

原创 程序存储问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*最短程序优先 */double a[50];//返回最多能存储的程序个数double greedy(int n, int len){ sort(a, a+n); //按程序长度排序 int i = 0; int

2015-11-23 09:39:31 636

原创 磁盘文件最优存储问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*将n个文件按概率排序,排序后有p1<=p2<=p3...<=pnf(n-1)占中心磁道,f(n-2)和f(n-3)分居f(n-1)两侧,f(n-4)和f(n-5)分居最外两侧 */double p[50];//返回n个文件的最小期望检索时间

2015-11-22 22:19:45 1399 1

原创 磁带最优存储问题

#include "iostream"#include "fstream"#include "queue"using namespace std;/*最短平均读取时间优先 */double p[50];int l[50];int y[50]; //存放每个程序的平均读取时间//返回n个程序的最小平均读取时间double greedy(int n){ int i;

2015-11-22 21:35:21 1379

原创 最优合并问题

#include "iostream"#include "fstream"//#include "vector"#include "queue"using namespace std;int a[50];//n为要合并的序列个数//返回最少合并次数int mergeMin(int n){ priority_queue< int, vector<int>, greater<int

2015-11-22 20:41:52 900

原创 会场安排问题

#include "iostream"#include "fstream"#include "algorithm"using namespace std;/*首先对n个活动的2n个端点排序,然后从左到右扫描,遇到开始时刻s[i],将活动i安排在一个空闲的会场中。遇到一个结束时刻f[i]就将活动i占用的会场释放。*/struct Point{ int time; //时间

2015-11-22 19:52:36 394

Rx_Net35_SP1

.Net 3.5 下使用 System.Threading.Tasks。安装后,在目录 C:\Program Files (x86)\Microsoft Reactive Extensions\Redist\DesktopV2 下找到 System.Threading.dll,添加引用即可

2019-03-13

简单的CNN示例代码,简单的CNN示例代码,

c++ 的简单的CNN示例代码。码。

2017-03-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除