#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
离线处理,并查集
#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
比较
既然我们获得了用户的输入,让我们把猜测的数据跟神秘数字做比较。这是我们的下一步,尽管它还不能真正工作:
extern crate rand;
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("G...
分类:
其他好文 时间:
2015-05-13 10:22:02
阅读次数:
276
循环
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
#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
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
题目求解的是最小生成树中的最大边:
一次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
比较简单的题目.
直接附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
转!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