- 博客(20)
- 资源 (6)
- 收藏
- 关注
原创 此博已封,转向cnblogs(www.cnblogs.com/slave_wc)
New Blog: www.cnblogs.com/slave_wc
2011-04-06 17:41:00
590
转载 Windows下用Eclipse搭建C/C++开发环境
<br />http://www.javaeye.com/topic/560534<br />本文假定你已经熟悉Java,Eclipse的安装,并能顺利启动和运行Eclipse.此外因为各软件版本在不断更新,有些地方可能不准确,以最新的、原文资料为准。 <br /><br />距上一次写和调C++程序,已经5、6年了,光阴荏苒岁月无情,现在再重新拾起来,很多东西都要从头来。Windows下C/C++的IDE有很多,我知道的就有MS Visual Studio,Borland C++等,但这些是要版权的。不要
2010-07-24 10:15:00
520
1
转载 ACM中Java的应用
<br />转载自:http://www.cppblog.com/vontroy/archive/2010/05/24/116233.html<br /> <br /> <br />转载自:http://www.cppblog.com/vontroy/archive/2010/05/24/116233.html先说一下Java对于ACM的一些优点吧:(1) 对于熟悉C/C++的程序员来说Java 并不难学,两周时间基本可以搞定一般的编程,再用些时间了解一下Java库就行了。 Java的语法和C+
2010-07-21 10:23:00
703
2
原创 HDU single round(2)
<br />http://acm.tju.edu.cn/toj/vcontest/ranklist6344.html<br /> <br />今天很杯具,加油ing!
2010-07-07 23:34:00
402
转载 memset用法
<br />转自 http://www.cppblog.com/SHFACM/archive/2009/02/04/73004.html<br />...
2010-07-07 09:43:00
466
原创 HDU 1690 Bus System
题目比较简单,根据图给的方式建边(len->cost)。唯一需要注意的地方:each number is non-negative and not larger than 1,000,000,000.但是最多是100个点,路径最长的时候10^9 * (100 - 1)已经超出int范围了。004467282010-07-04 19:27:18Accepted1013171 MS304 KBVisual C++Slave_wc#include #include #include #include
2010-07-07 09:36:00
957
原创 HDU 2722 Here We Go(relians) Again
<br />就是题目长... 只要构好图就可以了。<br />1:each block is a square measuring 2520 rels per side 。<br />2:The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip<br />每条边的边长都是2520,速度1-9. 所以按time = 2520 / speed 构图
2010-07-07 09:23:00
876
1
原创 HDU 2962 Trucking 三种解法。
去年联合训练的一道题,题意大致是:最短路,求使卡车高度尽量高的情况下的最短路径。即求st->ed可通的情况下卡车高度的最大值,并求在该最大高度下的最短路径。(实际上就是路径上最小高度的最大值)比较传统的算法是二分高度+最短路。004453232010-07-02 15:31:47Accepted1011640 MS8280 KBVisual C++Slave_wc#include #include #include #include using namespace std;#define
2010-07-05 19:11:00
855
1
原创 HDU 2923 Einbahnstrasse
<br />题意: (N , C , and R)<br />图中总共有n个城市, c 辆坏掉的车停在c个城市, 修理厂在某城市x。<br />求c 辆车 从修理厂x出发将所有车拖回修理厂的总时间。(一辆车拖回厂后再重新出发去拖第二辆,不同时拖运。)<br /> <br />#include <iostream>#include <cstring>#include <cstdio>#include <queue>#include <string>#include <map>using
2010-07-05 10:33:00
888
2
原创 HDU 2680 Choose the best route
<br />比较简单,加个超级源点就是最普通的最短路了。<br /> <br />004452552010-07-02 12:46:03Accepted1009250 MS4224 KBVisual C++Slave_wc<br /> <br />#include <iostream>#include <cstring>#include <cstdio>#include <queue>using namespace std;#define INF 0x3fffffff#define
2010-07-05 10:25:00
680
1
原创 HDU 1217 Arbitrage
<br />题意:<br />某些币种之间可以通过一定比率进行兑换,<br />问是否存在一种币种 经过若干次currency exchang回到原币种时,能够得到盈利。<br />即求 st * v1 * v2 * ... * vn * st 的一个最大值。<br />(1<=n<=30) 数据量较小,用动态规划思想的Floyd能求的最大值。<br /> <br />004452342010-07-02 11:40:04Accepted100846 MS300 KBVisual C++<br />Sla
2010-07-05 10:17:00
867
原创 HDU 1548 A strange lift
<br />电梯每层上有两个按钮 up,down 对应一个数ki。<br />若按 up 则上升 ki 层, down则下降 ki 层。<br />求how many times at least he have to press the button "UP" or "DOWN"?。<br /> <br />只是统计按键的次数,按一次,count 增一, 因此是无权图,简单bfs即可。<br /> <br />004451012010-07-01 23:40:54Accepted100731 MS276
2010-07-05 09:58:00
568
1
原创 HDU 1385 Minimum Transport Cost
题意:求最短路并输出字典序最小的路径。。。基本思路是:对从 start ->j 最短路径长度相同的点 ,进行比较他们路径的字典序。 这题WA很多次, 主要是在比较字典序的时候应该要从 start->j 进行比较的。而我理所当然的以为, 因为比较的最后一个节点是相同的, 就只从start -> pre[j] 进行比较, 这样就错了 . . . . . .例:1->2->5
2010-07-05 09:47:00
773
2
原创 HDU 1142 A Walk Through the Forest
<br />题目大意是给你一个图。起点为1,终点为2<br /><br />然后点a到点b是合法的判断(Notice 1:)是当b存在一个到终点的距离小于a到终点的最小距离,求从起点到终点的路径数。<br /> <br />Notice 1:不合法并非是断路,合法指回家的时候只按dis[b] < dis[a]的路线走、<br />dis[]表示到终点2的最短路径, 满足dis[b] < dis[a], 表示这样a->b的是可选择的。 就是说每次回家时选择从距起点(最短距离)近的点 向 距起点(最短距离)远的
2010-07-05 08:24:00
890
原创 HDU 1874 畅通工程续
<br />赤裸的最短路, (diy 1003)2066一个人的旅行用邻接表写的不知为何没过,<br />拿来改一下,交diy(1004)这题是AC的。 。 。<br />#include <iostream>#include <cstring>#include <string>#include <cstdio>#include <map>#include <queue>#include <algorithm>using namespace std;#define MAXN
2010-07-05 07:43:00
551
原创 HDU 2112 HDU Today
最短路径,就是地名是字符串,以前写这题是用字典树来hash,那样写起来麻烦点下面是用map来hash地名的。//pass:用邻接表写不知为何就是过不掉, 改成邻接阵就过了。。。下回再看看004443152010-06-30 15:03:13Accepted10031265 MS392 KBGNU C++Slave_wc#include #include #include #include #include #include using namespace std;#define
2010-07-05 07:33:00
754
1
原创 HDU 2066 一个人的旅行
<br />最短路, 求从k1个初始点 到 k2个终点中最短的一条路径长度。<br />设置一个超级源点 和 超级汇点即可, 使得超级源点到k1个初始点的权值为0,超级汇点. . .<br />下面是用priority_queue优化的Dijkstra代码:<br />78ms。<br />#include <iostream>#include <cstring>#include <cstdio>#include <queue>#include <algorithm>using name
2010-07-04 23:55:00
837
2
原创 HDU 2544 最短路
<br />赤裸裸的最短路:Dijkstra算法<br />#include <iostream>#include <cstdio>#include <cstring>using namespace std;#define INF 0x3fffffffint map[110][110];int dis[110];bool hash[110];void init(int n){ for (int i = 1; i <= n; i++) {
2010-07-04 23:43:00
591
原创 HDU 1053 && PKU 1521 Entropy (PKU 3253, HDU 2527同解)
Huffman编码, 题意:给你一个序列,output the length in bits of the 8-bit ASCII encoding, the length in bits of an optimal prefix-free variable-length encoding, and the compression ratio accurate to one decimal poi
2010-05-29 16:06:00
1516
原创 HDU 1710-Binary Tree Traversals
好久没好好AC了, 这学期的数据结构也没好好学。恶补ing... 题目大意:告诉二叉树的先序序列和中序序列,求后序序列。思路:先序建立二叉链表,再后续遍历二叉树。 #include using namespace std;typedef struct Binary{ int data; Binary *lchild, *rchild;
2010-05-29 15:07:00
780
Java计算器考核报告和源码
2010-06-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人