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
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
题意:给定一个序列,求它的下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
题意:
给出一个串,要求按照字典序输出所有排列。分析:
直接利用STL 里的next_permutation()就好,重新定义一个cmp函数,没有把cmp放进next_permutation(),我都WA哭了。。。#include
#include
#include
#include
#include ...
分类:
其他好文 时间:
2015-05-24 13:00:31
阅读次数:
143
思路还是很简单的,不过关键在于剪枝,用了几个不强力的剪枝,飘过~~~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
这一题,简单的贪心就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提供了自己的原子操作,但是该原子操作使用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
#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
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