Description给你一个无向图,N(N#include#include#includeusing namespace std;struct node{ int x,y,w;}e[5001];int n,m;int s,t;int fa[501];bool cmp(node a,node ...
分类:
其他好文 时间:
2015-04-05 17:16:28
阅读次数:
115
#include#includetypedef struct{ char *mem; char len;}m_table_t;int table_cmp(m_table_t *p1, m_table_t *p2){ int ret; if(p1->len == p2->le...
分类:
其他好文 时间:
2015-04-04 18:14:01
阅读次数:
131
控制结构主要是关于 if/else switch/case
废话不多说。。献上代码及反汇编分析。。
#include
int main(int argc , char *argv[])
{
int nInt = 9;
// if(0 == nInt)
__asm
{
cmp DWORD PTR [EBP - 4h] , 0 ;
jle __exit;
}
// __...
分类:
其他好文 时间:
2015-04-01 23:52:29
阅读次数:
177
n
#include
#include
#include
using namespace std;
typedef long long ll;
#define N 1005
char s[N];
int r[N];
int wa[N],wb[N],wv[N],ws[N],Rank[N],sa[N],height[N];
int cmp(int *r,int a,int b,int l){
r...
分类:
其他好文 时间:
2015-04-01 21:55:06
阅读次数:
126
题意:
裸的凸包。
分析:
graham模板直接上。
代码:
//poj 3787
//sep9
#include
#include
using namespace std;
const int maxN=64;
struct P
{
int x,y;
}pnt[maxN],cnt[maxN];
int n;
int cmp(P a,P b)
{
if(a.y!=b.y)
...
分类:
其他好文 时间:
2015-04-01 09:38:55
阅读次数:
174
一、DPDK系统需求:1、需要的编译工具(ubuntu12.04LTS均符合要求,可以不检查)GNUmake;cmp,sed,grep,arch;gcc;libc库文件(glibc-develfedora;libcubuntu)kernel-devel(fedora);kernel-dev(ubuntu)python2.6or2.72、运行条件(关键在于kernel的配置,其他均符合条件)kernel-v..
分类:
其他好文 时间:
2015-03-31 20:27:35
阅读次数:
396
区别
sort是qsort的升级版,如果能用sort尽量用sort,使用也比较简单,不像qsort还得自己去写 cmp 函数,
只要注明 使用的库函数就可以使用,参数只有两个(如果是普通用法)头指针和尾指针;
默认sort排序后是升序,如果想让他降序排列,可以使用自己编的cmp函数
bool compare(int a,int b)
{
return a>b; //降序排列,如...
分类:
其他好文 时间:
2015-03-31 16:10:56
阅读次数:
196
优先队列
#include bits/stdc++.h>using namespace std;struct cmp{ bool operator() (const int a, const int b) const{ return a%10 > b%10;///定义个位数小的优先级大 }};int main(){ priority_queueint, vecto...
分类:
其他好文 时间:
2015-03-28 08:59:02
阅读次数:
128
【思路】:vector完美解决。注意用vector的动态数组方式,不然又其他的零。
【AC代码】:
#include
#include
#include
#include
#include
using namespace std;
#define MAX 100+5
int cmp(int a, int b)
{
return a < b;
}
int main()
{
/...
分类:
编程语言 时间:
2015-03-27 22:23:43
阅读次数:
241
sort排序,注意ba,b的情况,结果应该是bab而不是bba,只需要在cmp函数里判断b+ba和ba+b的大小即可! 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 string s[10]; 8 9 bool...
分类:
其他好文 时间:
2015-03-21 11:03:45
阅读次数:
139