上一页 1 ··· 209 210 211 212 213 214 215 216 217 ··· 249 下一页
摘要: 点击打开poj 2926思路: n维空间计算最远的曼哈顿距离 分析: 1 题目给定n个5维的点,要求最远的曼哈顿距离 2 求最远曼哈顿距离,对于一个n维的空间,其中两点的曼哈顿距离为:|x1-x2|+|y1-y2|+... , 两点的坐标分别为(x1,y1……)和(x2,y2,……)3 考虑二维的情况对于二维空间的两个点(x1,y1)和 (x2,y2),那么曼哈顿距离为|x1-x2|+|y1-y2|那么我们去掉绝对值之后就有四种情况(x1-x2)+(y1-y2) , -(x1-x2)+(y1-y2) ,(x1-x2)-(y1-y2) ,-(x1-x2)-(y1-y2)那么我们把相同点的放在一起 阅读全文
posted @ 2013-08-14 19:37 pangbangb 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=3414 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22009#problem/J Pots Time Limit:1000MSMemory Limit:65536K Total Submissions:8253Accepted:3499Special Judge DescriptionYou are given two pots, having the volume ofAandBli... 阅读全文
posted @ 2013-08-14 19:35 pangbangb 阅读(588) 评论(1) 推荐(0) 编辑
摘要: Wa的版本。。。/*DPdp[i][j]:前i个取某些个且cost不超过j得到的最大价值*/#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long int64;//typedef __int64 int64;typedef pair PII;#define MP(a,b) make_pair((a),(b)) const int maxn = 105;const int maxm = 10005;const int 阅读全文
posted @ 2013-08-14 19:33 pangbangb 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 在某些应用场合下,我们可能需要在启动A进程启动时关闭进程B。MFC下该如何做呢?以下是我项目中用到的代码:int KillProcess(DWORD Pid){ //打开进程得到进程句柄 HANDLE hProcess=OpenProcess(PROCESS_ALL_ACCESS,FALSE,Pid); if(hProcess==NULL) { printf("OpenProcess error\n"); return 0; } //结束进程 if (TerminateProcess(hProcess,0)) { printf("结束进程成功\n"); 阅读全文
posted @ 2013-08-14 19:31 pangbangb 阅读(1729) 评论(0) 推荐(0) 编辑
摘要: ----------------------------------------------------------- #!/bin/bash set -e command 1 command 2 ... exit 0 ---------------------------------------------------------- Every script you write should include set -e at the top. This tells bash that it should exit the script if any statement returns a. 阅读全文
posted @ 2013-08-14 19:28 pangbangb 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 建议先学会用康托展开:http://blog.csdn.net/u010372095/article/details/9904497 Problem Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into 阅读全文
posted @ 2013-08-14 19:26 pangbangb 阅读(291) 评论(0) 推荐(0) 编辑
摘要: TCP(Transmission Control Protocol) TCP(又叫传输控制协议),是一种面向连接的、可靠的、基于字节流的传输层通信协议。TCP连接包括三个状态:连接创建、数据传送和连接终止。三次握手: 1.第一次握手:客户端通过向服务端发送一个SYN来创建一个主动打开,作为三次握手的一部分。简单的说,就是客户端询问服务端,我可以向你发送数据么? 2.第二次握手:服务端应当为一个合法的SYN回送一个SYN/ACK。简单的说就是,服务端回复客户端说,你可以发,你什么时候发? 3.第三次握手:客户端在发送一个ACK。就是客户端告诉服务端,我现在就发,你接着吧。这样就完成了三次握... 阅读全文
posted @ 2013-08-14 19:24 pangbangb 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is apolynomial like this:(a0*x^(2^0)+1) * (a1* x^(2^1)+1)*.......*(an-1* x^(2^(n-1))+1). Then Alice ask Bob Q questions. In theexpansion of the Polynomial, Given an integer P, please tell the coefficient of the.. 阅读全文
posted @ 2013-08-14 19:21 pangbangb 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 翻译整理自:http://guides.rubyonrails.org/v3.2.13/association_basics.html想吐槽一句,http://guides.ruby-china.org/ 翻译地太慢了!!!csdn 复制过来格式都有误啊,改格式改了好几遍了。烦心。。。。什么时候能支持markdown呢-。- Rails支持以下6种关联类型: belongs_to has_one has_many has_many :through has_one :through has_and_belongs_to_many 1. belongs_to :在两个model间建立一... 阅读全文
posted @ 2013-08-14 19:19 pangbangb 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 排序算法系列学习,主要描述冒泡排序,选择排序,直接插入排序,希尔排序,堆排序,归并排序,快速排序等排序进行分析。文章规划:一。通过自己对排序算法本身的理解,对每个方法写个小测试程序。具体思路分析不展开描述。二。通过《大话数据结构》一书的截图,详细分析该算法。在此,推荐下程杰老师的《大话数据结构》一书,当然不是打广告,只是以一名读者的身份来客观的看待这本书,确实是通俗易懂,值得一看。ps:一个较为详细的学习链接 http://blog.csdn.net/guo_hongjun1611/article/details/7632047 五。堆排序一。个人理解 学习堆排序,要了解以下两方面内容... 阅读全文
posted @ 2013-08-14 19:17 pangbangb 阅读(410) 评论(0) 推荐(1) 编辑
上一页 1 ··· 209 210 211 212 213 214 215 216 217 ··· 249 下一页