码迷,mamicode.com
首页 >  
搜索关键字:cmp    ( 878个结果
poj 1088 滑雪
#include#include#include#includeusing namespace std;int mapp[111][111];int uu[111][111];struct abc{ int x, y, hh; } node[111 * 111];bool cmp(const abc...
分类:其他好文   时间:2015-05-17 18:30:45    阅读次数:100
【FZU】Problem 2059 MM(离线处理并查集)
离线处理,并查集 #include #include #include using namespace std; const int maxn = 100005; struct Node{ int id,value; }node[maxn],input[maxn]; bool cmp(Node p,Node q){ return p.value > q.value;...
分类:其他好文   时间:2015-05-15 22:55:32    阅读次数:117
Rust猜数字之比较
比较      既然我们获得了用户的输入,让我们把猜测的数据跟神秘数字做比较。这是我们的下一步,尽管它还不能真正工作: extern crate rand; use std::io; use std::cmp::Ordering; use rand::Rng; fn main() { println!("G...
分类:其他好文   时间:2015-05-13 10:22:02    阅读次数:276
Rust猜数字之循环
循环      loop关键字给我们一个无限循环。让我们添加它: extern crate rand; use std::io; use std::cmp::Ordering; use rand::Rng; fn main() { println!("Guess the number!"); ...
分类:其他好文   时间:2015-05-13 10:21:05    阅读次数:207
STL中堆的应用
#include#include#include#include#include#include#includeusing namespace std;int a[100];bool cmp(int a,int b){ return a>b;}int main(){//-----------...
分类:其他好文   时间:2015-05-12 18:47:27    阅读次数:91
华为机试—元素按奇偶排序
题目: 将数组中偶数从大到小排序,奇数从小到大排序,奇数和偶数交叉着放且输出数组第一位放奇数 若奇数和偶数不等长,则把剩下的直接放到数组中。 #include #include #define len 11 using namespace std; int cmp(const void *p,const void *q) { return *(int *)p-*(int *)q;...
分类:编程语言   时间:2015-05-12 11:26:49    阅读次数:125
140809暑期培训
1、用sort对结构体中字符串进行二级排序 #include #include using namespace std; struct s { int d; char c[10]; }ss[15]; bool cmp(s a,s b) { ...
分类:其他好文   时间:2015-05-10 11:20:29    阅读次数:94
北大ACM2395——Out of Hay~~最小生成树
题目求解的是最小生成树中的最大边: 一次AC代码: #include #include #include using namespace std; class data { public: int from, to, cost; }; data Edge[10005]; int par[2005]; int N, M, num; int cmp(const data& a, co...
分类:其他好文   时间:2015-05-06 15:10:08    阅读次数:117
北大ACM1258——Agri-Net~~最小生成树
比较简单的题目. 直接附AC的代码: #include #include #include using namespace std; class data { public: int form, to, height; }; data Edge[10005]; int N, num, par[105]; int cmp(const data& a, const data& b) ...
分类:Web程序   时间:2015-05-06 13:16:39    阅读次数:121
C语言qsort的用法
转!http://blog.sina.com.cn/s/blog_5155e8d401009145.htmlqsort,包含在stdlib.h头文件里,函数一共四个参数,没返回值.一个典型的qsort的写法如下qsort(s,n,sizeof(s[0]),cmp);其中第一个参数是参与排序的数组名(...
分类:编程语言   时间:2015-05-06 10:38:11    阅读次数:215
878条   上一页 1 ... 59 60 61 62 63 ... 88 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!