码迷,mamicode.com
首页 >  
搜索关键字:cmp    ( 878个结果
poj 1694 An Old Stone Game 树形dp
//poj 1694 //sep9 #include #include using namespace std; const int maxN=256; int n; int tree[maxN][maxN]; int ans[maxN]; int cmp(int a,int b) { return a>b; } int dfs(int u) { int tmp[maxN],t=0; i...
分类:其他好文   时间:2015-07-02 12:09:15    阅读次数:148
华为 2015 笔试题练习
1.2015 华为(1):#include #include #include #include int cmp(const void *a, const void *b){ return *(int*)a - *(int*)b;}int main(){ char strIn[4096] = {'\...
分类:其他好文   时间:2015-06-30 23:25:25    阅读次数:171
Rust中文翻译7
去台湾玩儿了一个礼拜,赶紧回来继续翻译吧! 3.1.5 循环 Page 38 loop关键字可以实现一个无限循环.让我们来加入一个循环: extern crate rand; use std::io; use std::cmp::Ordering; use rand::Rng; fn main() {      println!("Guess the nu...
分类:其他好文   时间:2015-06-30 22:08:42    阅读次数:229
python __str__ & __repr__ & __cmp__
For ( __str__ ),we going to see a example ...and find who is working for ...#!/usr/bin/pythonclass Person(object): def __init__(self,name,gende...
分类:编程语言   时间:2015-06-28 15:34:42    阅读次数:136
POJ1256
去重复的排列。直接DFS。然而WA三次,后来看题解才发现、、、这是个奇葩的字典序、、所以还要重写cmp比较函数。 1 /************************* 2 POJ 1256 3 728K 4 360MS 5 2015-06-27 6 By ...
分类:其他好文   时间:2015-06-27 18:14:12    阅读次数:298
vijos 1234 口袋的天空
最小生成树kruscal算法 #include #include #include #define maxn 10005 using namespace std; struct stu { int x,y; int t; }; stu mapp[maxn]; int f[1005]; int n,m,k,sum,flag; bool cmp(stu x,stu y) { return x....
分类:其他好文   时间:2015-06-23 18:02:53    阅读次数:81
BZOJ1665 : [Usaco2006 Open]The Climbing Wall 攀岩
直接BFS貌似复杂度飞起来了,于是我们用k-d tree优化找点的过程即可。时间复杂度$O(n\sqrt{n})$。#include#includeconst int N=10010,H=1000,R=1000000;int n,m,i,root,cmp_d,h=1,t,q[N],f[N],mx,m...
分类:其他好文   时间:2015-06-19 15:06:59    阅读次数:114
最小生成树算法(2)------------Kruskal
#include #include using namespace std; #define MAX 1000 struct edge { int u; //顶点 int v; //顶点 int w; //权重 }e[MAX]; //边集 int f[MAX]; //代表n个顶点所对应的并查集 //sort的比较函数 bool cmp(edge a,edge b)...
分类:编程语言   时间:2015-06-17 21:34:28    阅读次数:176
poj2388---求奇数个数字的最中间的数
#include #include int cmp(const void *a,const void *b){ return (*(int *)a-*(int *)b);}int main(){ int n,arr[10001],i; scanf("%d",&n); for(...
分类:其他好文   时间:2015-06-14 12:23:37    阅读次数:128
POJ 1328 Radar Installation(贪心)
在区间上贪心 #include #include #include using namespace std; struct point { double x1,x2; }p[1005]; bool cmp(point a,point b) { return a.x1<b.x1; } int main() { int n,r,i,t,end_flag,count; doub...
分类:其他好文   时间:2015-06-12 19:26:34    阅读次数:151
878条   上一页 1 ... 55 56 57 58 59 ... 88 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!