码迷,mamicode.com
首页 >  
搜索关键字:cmp    ( 878个结果
杭电 2037
考察的是结构体的二次快排   #include #include typedef struct Node{  int fir;  int end; }Node; Node node[110]; int cmp(const void *a,const void *b) {  return (*(node *)a).end>(*(node *)b).end?1:-1; } i...
分类:其他好文   时间:2014-07-28 16:15:23    阅读次数:218
Automatic Editing UVA 10115
#include #include #define MAXL 225+5 #define MAXN 10+5 char find[MAXN][MAXL],replace[MAXN][MAXL]; char text[MAXL],convert[MAXL]; int Find(int,int*); void Replace(int,int); int str_cmp(int,int); i...
分类:其他好文   时间:2014-07-27 23:55:20    阅读次数:273
CodeForces 451B
#include #include using namespace std; #define max 100010 int a[max],b[max]; bool cmp(int a,int b){ return a>n){ for(int i=0;i>a[i]; b[i]=a[i]; ...
分类:其他好文   时间:2014-07-27 23:18:59    阅读次数:438
LeetCode Anagrams
struct mystat { int idx; int cnt[26]; mystat(int id = 0) {idx = id;}};bool cmp(const mystat &a, const mystat &b) { for (int i=0; i b.cnt[i...
分类:其他好文   时间:2014-07-27 21:53:19    阅读次数:177
python 中 sorted() 和 list.sort() 的用法
今天用python自带的sorted对一个列表进行排序, 在这里总结一下只要是可迭代对象都可以用sorted 。sorted(itrearble, cmp=None, key=None, reverse=False)=号后面是默认值 默认是升序排序的, 如果想让结果降序排列,用reverse=Tru...
分类:编程语言   时间:2014-07-26 14:49:40    阅读次数:284
hdu 2546饭卡
#include #include #include int s[1050]; int dp[1050]; int cmp(const void *a,const void * b) { return *(int *)b-*(int *)a; } int maxx(int a,int b) {return a>b?a:b;} int main() { int n,i,j,sum,MA...
分类:其他好文   时间:2014-07-26 02:20:36    阅读次数:193
hdu 4882 ZCC Loves Codefires(贪心)
# include # include # include using namespace std; struct node { int v; int t; }; struct node a[100010]; bool cmp(node a,node b) { return a.v *a.t+(a.v+b.v)*b.t<b.v*b.t+(a.v+b.v)*a.t; }...
分类:其他好文   时间:2014-07-24 23:16:23    阅读次数:268
hdu 4864 Task (贪心)
# include # include # include using namespace std; struct node { int t; int v; int yy; }; struct node a[100010],b[100010]; bool cmp(node a1,node a2) { if(a1.t==a2.t)//先按时间从大到小 return a1.v>a2....
分类:其他好文   时间:2014-07-24 23:10:33    阅读次数:238
ZOJ1093 Monkey and Banana 【DP】
一、题目ZOJ 1093二、题目源程序#include //一个箱子有3种h..所以总共有3*n种高度.按面积从大到小排序#include struct block{ int x,y,z,h;}a[200];int cmp(const void *a,const void *b)//快排,模版{ r...
分类:其他好文   时间:2014-07-23 16:55:21    阅读次数:198
转:ElasticSearch 简单入门
原文来自于:http://www.oschina.net/translate/elasticsearch-getting-started?cmp教程样例我们将要部署一个非常简单的应用--在一个部门里的雇员--这样我们可以把注意力放在功能而不是氧立得复杂性上。总而言之,这篇博文是为了帮助人们开始Ela...
分类:其他好文   时间:2014-07-23 15:07:36    阅读次数:213
878条   上一页 1 ... 81 82 83 84 85 ... 88 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!