码迷,mamicode.com
首页 >  
搜索关键字:cmp    ( 878个结果
Kruskal算法的实现
1 #include "stdio.h" 2 #include "stdlib.h" 3 struct edge 4 { 5 int m; 6 int n; 7 int d; 8 }a[5010]; 9 int cmp(const void *a,const void *b...
分类:编程语言   时间:2015-05-26 20:26:59    阅读次数:147
苹果(背包)
#include#include#includeusing namespace std;int bag[1001];struct Case{ int c,w;}apple[1010];/*int cmp(Case a,Case b){ return (1.0*a.w/a.c)>(1.0*b.w/b....
分类:移动开发   时间:2015-05-26 00:13:23    阅读次数:177
partial与sorted
import functoolssorted_ignore_case = functools.partial(sorted,cmp=lambda s1, s2: cmp(s1.upper(), s2.upper()),key=str.lower)print sorted_ignore_case(['...
分类:其他好文   时间:2015-05-25 07:25:46    阅读次数:147
poj1833---字典序算法
题意:给定一个序列,求它的下k个排列#include #include int cmp(const void *a,const void *b){ return (*(int *)a-*(int *)b);}void getNext(int *arr,int n){ int i,j,fl...
分类:编程语言   时间:2015-05-25 00:55:40    阅读次数:238
[排列]poj1256
题意: 给出一个串,要求按照字典序输出所有排列。分析: 直接利用STL 里的next_permutation()就好,重新定义一个cmp函数,没有把cmp放进next_permutation(),我都WA哭了。。。#include #include #include #include #include ...
分类:其他好文   时间:2015-05-24 13:00:31    阅读次数:143
hdu 1455 hdu 1455 Sticks
思路还是很简单的,不过关键在于剪枝,用了几个不强力的剪枝,飘过~~~998ms #include #include #include #define maxn 65+5 using namespace std; int maxx,n,m,flag,l; int mapp[maxn]; int visit[maxn]; bool cmp(int x,int y) { return x>y;...
分类:其他好文   时间:2015-05-23 18:27:41    阅读次数:109
杭电ACM2187——悼念512汶川大地震遇难同胞——老人是真饿了~~贪心
这一题,简单的贪心就OK了。 下面是AC的代码: #include #include #include using namespace std; class data { public: int price, height; }; int M, N; data Date[1005]; int cmp(const data &a, const data &b) { re...
分类:其他好文   时间:2015-05-22 09:47:46    阅读次数:124
Nginx中的原子操作
在不支持原子操作的处理器上Nginx提供了自己的原子操作,但是该原子操作使用C语言模拟的: static ngx_inline ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, ngx_atomic_uint_t set) { if (*lock == old) { ...
分类:其他好文   时间:2015-05-21 17:26:49    阅读次数:153
HDU 1455 http://acm.hdu.edu.cn/showproblem.php?pid=1455
#include#include#include#include#define N 70int f, vis[N], v, n, a[N];int cmp(const void *a, const void *b){ return *(int *)b - *(int *)a;}void DFS...
分类:Web程序   时间:2015-05-20 22:07:24    阅读次数:112
MSP430之instruction之CMP
CMP[.W] Compare source and destinationCMP.B Compare source and destinationSyntax CMP src,dst or CMP.W src,dst CMP.B src,dstOperatio...
分类:其他好文   时间:2015-05-18 18:05:46    阅读次数:125
878条   上一页 1 ... 58 59 60 61 62 ... 88 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!