按类别查询搜索结果
关于关键词 的检测结果,共 3364
还看今早 | 2015-08-06 16:46:03 | 阅读(110) | 评论(0)
1.多人排成一个队列,我们认为从低到高是正确的序列,但是总有部分人不遵守秩序。如果说,前面的人比后面的人高(两人身高一样认为是合适的), 那么我们就认为这两个人是一对“捣乱分子”,比如说,现在存在一个序列:176, 178, 180, 170, 171这些捣乱分子对为<176, 170>, <176, 171>, <178, 170>, <178, 171>, <180, 170>, <180, 171>,那么,现在给出一个整型序列,请找出这些捣乱分子对的个数(仅给出捣乱分子对的数目即可,不用具体的对)要求:输入:为一个文【阅读全文】
还看今早 | 2015-08-06 16:45:49 | 阅读(180) | 评论(0)
练手代码,codepad.org已验证。该算法为海量数据的求第k大的数的解法之一。建立大小为k的最小堆,每输入一个数,如果比堆顶大,那么替换堆顶元素,然后维护最小堆的特性。堆顶元素即为第k大的数。 点击(此处)折叠或打开#include <stdio.h>#include <stdlib.h>#include <assert.h>#define LEFT(a) ((a)<<1)+1#define RIGHT(a) ((a)<<1)+2#define SWAP(a,b) a^=b;b^=a;a^=b;int heapcount;int*【阅读全文】
还看今早 | 2015-08-06 16:44:10 | 阅读(90) | 评论(0)
求给定数组中的连续子数组的最大乘积。   简单DP,练手。codepad.org已验证 点击(此处)折叠或打开 #include <stdio.h> #include <stdlib.h> #include <memory.h> #define MAX 1000 int getmaxsub(int *input, int size){     if(input == NULL || size == 0) return 0xFFFF;   &nbs【阅读全文】
还看今早 | 2015-08-06 16:42:57 | 阅读(130) | 评论(0)
网上收集的几道电面题。 除了第一题,都是牵涉基本功,第一题也可以认为是算法基本功,不算很难。要点是细节。代码要写强壮。 1.平面上的很多点,要你找出一条直线,使最多的点在同一条直线上 回溯+hashhttp://stackoverflow.com/questions/4179581/what-is-the-most-efficient-algorithm-to-find-a-straight-line-that-goes-through-m 2.整形数组 {1,1,2,3,3,5} ,去掉重复数结果是{1,2,3,5}并返回个数4。 点击(此处)折叠或打开 #inc【阅读全文】
还看今早 | 2015-08-06 16:42:28 | 阅读(220) | 评论(0)
【问题描述】题目很简单,给出N个数字,不改变它们的相对位置,在中间加入K个乘号和N-K-1个加号,(括号随便加)使最终结果尽量大。因为乘号和加号一共就是N-1个了,所以恰好每两个相邻数字之间都有一个符号。例如:N=5,K=2,5个数字分别为1、2、3、4、5,可以加成:1*2*(3+4+5)=241*(2+3)*(4+5)=45...【阅读全文】
kyle6 | 2015-08-04 21:44:23 | 阅读(60) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="cursor:pointer;color:red;" onclick="code_hide('code240')">此处</span>)折叠或打开</p></div><div id="code240" class="codeText"><ol style="margin:0 1px 0 0px;padding-left:40px;" start="1" class="dp-css"><li><span style=...【阅读全文】
bellsleep | 2015-08-03 14:48:03 | 阅读(700) | 评论(0)
本文从解释char **无法赋给 const char**,解释了const限定符的修饰范围【阅读全文】
mxh1634845356 | 2015-08-03 09:30:43 | 阅读(1680) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="color:red;cursor:pointer;" onclick="code_hide('code129')">此处</span>)折叠或打开</p></div><div id="code129" class="codeText"><ol style="margin:0px 1px 0px 0px;padding-left:40px;" class="dp-css" start="1"><li><span st...【阅读全文】
mxh1634845356 | 2015-08-03 09:13:50 | 阅读(1540) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="color:red;cursor:pointer;" onclick="code_hide('code510')">此处</span>)折叠或打开</p></div><div id="code510" class="codeText"><ol style="margin:0px 1px 0px 0px;padding-left:40px;" class="dp-css" start="1"><li><span st...【阅读全文】
mxh1634845356 | 2015-08-02 19:30:36 | 阅读(1440) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="color:red;cursor:pointer;" onclick="code_hide('code754')">此处</span>)折叠或打开</p></div><div id="code754" class="codeText"><ol style="margin:0px 1px 0px 0px;padding-left:40px;" class="dp-css" start="1"><li><span st...【阅读全文】
mxh1634845356 | 2015-08-02 19:27:24 | 阅读(1590) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="color:red;cursor:pointer;" onclick="code_hide('code458')">此处</span>)折叠或打开</p></div><div id="code458" class="codeText"><ol style="margin:0px 1px 0px 0px;padding-left:40px;" class="dp-css" start="1"><li><span st...【阅读全文】
mxh1634845356 | 2015-08-02 19:14:23 | 阅读(1730) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="color:red;cursor:pointer;" onclick="code_hide('code697')">此处</span>)折叠或打开</p></div><div id="code697" class="codeText"><ol style="margin:0px 1px 0px 0px;padding-left:40px;" class="dp-css" start="1"><li><span st...【阅读全文】
【C/C++】 bug
cu小白 | 2015-07-31 15:48:30 | 阅读(1020) | 评论(0)
<br /><div><div class="codeheads"><p>点击(<span style="cursor:pointer;color:red;" onclick="code_hide('code537')">此处</span>)折叠或打开</p></div><div id="code537" class="codeText"></div></div><br /><br />#if 0<br />// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n...【阅读全文】
sxcong | 2015-07-31 13:47:54 | 阅读(4510) | 评论(0)
protobuf在Python和Java之间通信测试例子【阅读全文】
老顽童熊 | 2015-07-30 18:06:58 | 阅读(970) | 评论(0)
tianyalangz | 2015-07-30 15:08:16 | 阅读(240) | 评论(0)
y_thomas | 2015-07-30 09:53:54 | 阅读(210) | 评论(0)
【C/C++】 号量
叫我小潘啦丶 | 2015-07-24 19:53:46 | 阅读(1230) | 评论(0)
kongyu68 | 2015-07-23 09:09:53 | 阅读(680) | 评论(0)
<span style="white-space:normal;font-family:微软雅黑;font-size:18px;line-height:normal;orphans:2;text-align:-webkit-auto;widows:2;color:#000000;background-color:#FFFFFF;">&nbsp;前面我们学习了一下进程,我们知道多,进程间的地址空间相对独立。进程与进程间不能像线程间通过全局变量通信。&nbsp;如果想进程间...【阅读全文】
lineuman | 2015-07-20 19:11:22 | 阅读(730) | 评论(0)