//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
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
去台湾玩儿了一个礼拜,赶紧回来继续翻译吧!
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
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
去重复的排列。直接DFS。然而WA三次,后来看题解才发现、、、这是个奇葩的字典序、、所以还要重写cmp比较函数。 1 /************************* 2 POJ 1256 3 728K 4 360MS 5 2015-06-27 6 By ...
分类:
其他好文 时间:
2015-06-27 18:14:12
阅读次数:
298
最小生成树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
直接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
#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
#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
在区间上贪心
#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