码迷,mamicode.com
首页 >  
搜索关键字:cmp    ( 878个结果
tarjan 算法求强连通分量
1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N=1e4+5; 4 int cmp[N],dfn[N],tot,n,m;// dfn为节点的时间戳 5 bool vis[N]; 6 stack<int> st; 7 vect ...
分类:编程语言   时间:2017-10-27 20:35:34    阅读次数:220
Python2 字典 cmp()函数
描述 Python 字典的 cmp() 函数用于比较两个字典元素,如果 dict1 < dict2 返回 -1, 如果 dict1 == dict2 返回 0, 如果 dict1 > dict2 返回 1。 语法 cmp()函数语法: 参数 dict1 -- 比较的字典。 dict2 -- 比较的字 ...
分类:编程语言   时间:2017-10-27 01:19:04    阅读次数:258
Python帮助及变量类型强制转换
一、帮助dir()dir函数查看属性示例:a=[1,‘abc‘,‘dh‘,‘ft‘,678]print(dir(a))help()示例help(sorted)#显示#sorted(...)#sorted(iterable,cmp=None,key=None,reverse=False)-->newsortedlist#type()#ctrl加鼠标左键,可了解函数用法二、变量类型强制转换age=20print(‘Myageis:..
分类:编程语言   时间:2017-10-25 23:55:34    阅读次数:301
python常用函数
1、取绝对值函数:abs() 。 2、比较函数: cmp(x, y) ,需要两个参数,如果 x<y,返回 -1,如果 x==y,返回 0,如果 x>y,返回 1。 3、int()函数可以把其他数据类型转换为整数。 4、str()函数把其他类型转换成 str。 ...
分类:编程语言   时间:2017-10-23 01:06:21    阅读次数:184
python 压缩 解压
unrar在Linux机器中对中文的支持有漏洞 components.py 利用python 对各种格式的文件压缩 解压 操作,文件的一些操作,目录结构读成字典的形式,字典的比较方法(http://www.runoob.com/python/att-dictionary-cmp.html)。 ...
分类:编程语言   时间:2017-10-12 14:03:34    阅读次数:169
uvalive 6938 区间dp
看到n范围和给的区间看着就像区间dp 然后怎么cmp感觉都没法进行区间合并 n的300误导了下 没有注意离散化之后对时间可以dp 然而这个dp感觉不太经得起证明的样子... dp[i][j] -> 把完全包含在[i,j]里面的区间打完的cost 那么枚举裂缝 需要加上的是 跨越裂缝的区间的cost ...
分类:其他好文   时间:2017-10-09 14:06:33    阅读次数:165
用sort给字符串排序
按照字典序排序:c++版:string s[21]; for(int i=0;i <20;i++) cin>>s[i]; sort(s,s+20);不用写cmp函数,string 类提供了operator。但这只是按照字典序排序的,按长度排序如下:按长度排序:c++版:#include<iostre ...
分类:编程语言   时间:2017-10-06 21:57:01    阅读次数:314
导弹拦截
#include #include #include #include using namespace std; struct point{ int l1,l2; }; point p[100005]; bool cmp(point A,point B) { return A.l1>B.l1; } ... ...
分类:其他好文   时间:2017-10-06 21:23:12    阅读次数:148
luogu_1120 小木棍
#include #include #include using namespace std; const int N=70; int n,a[N],cnt,maxn,maxnn; bool cmp(int x,int y){return x>y;} bool use[N]; inline void... ...
分类:其他好文   时间:2017-10-06 17:32:43    阅读次数:93
luogu_1111 修复公路
#include #include #include using namespace std; int n,m,p[1010],t,cnt,ans,sum; struct edge{int u,v,w;}e[100010]; bool cmp(edge x,edge y){return x.w<y.... ...
分类:其他好文   时间:2017-09-29 14:00:19    阅读次数:103
878条   上一页 1 ... 26 27 28 29 30 ... 88 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!