上一页 1 ··· 67 68 69 70 71
摘要: http://poj.org/problem?id=1611 Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a g 阅读全文
posted @ 2014-06-08 21:00 人艰不拆_zmc 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 被坑了3个小时,本来以为算法错了,谁知道,竟然是素数筛弄错了 !!! #include <iostream>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>using namespace std;int 阅读全文
posted @ 2014-06-08 14:03 人艰不拆_zmc 阅读(231) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3278 Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 47010 Accepted: 14766 Description Farmer John 阅读全文
posted @ 2014-06-08 10:40 人艰不拆_zmc 阅读(394) 评论(0) 推荐(0) 编辑
摘要: sort: 一、对int类型数组排序 int a[100]; int cmp ( int a , int b ) //不必强制转换 { return a < b;//升序排列。 } sort (a(数组名) , a+100(数组最后一个元素), cmp); 头文件 #include<algorith 阅读全文
posted @ 2014-04-20 19:52 人艰不拆_zmc 阅读(426) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>int n,m;typedef struct node{ int date; struct node *next;}node; int main(){ int i,sum=0,count= 阅读全文
posted @ 2014-04-17 20:32 人艰不拆_zmc 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>int map[200][200],v[200],dis[200];int n,s,t;#define N 100001void DJ(){ int i,j,k,min; memset(v,0,sizeof(v)); mems 阅读全文
posted @ 2014-04-17 20:01 人艰不拆_zmc 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>void qsort(int a[],int l,int r){ int x=a[l]; int i=l; int j=r; if(l>=r) return ; while(i<j) { while(i<j&&a[j]>=x) j--; if(i<j) { a[i 阅读全文
posted @ 2014-04-15 21:26 人艰不拆_zmc 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int bin[50010]; int findx(int x){ int r=x; while(r!=bin[r]) r=bin[r]; int j=x; int k; while(bin[j]!=r) { k=bin[j]; bin[j]=r; j=k; } 阅读全文
posted @ 2014-04-15 21:06 人艰不拆_zmc 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>int n;#define N 100001int a[100001],b[100001];int main(){ int i,j,ad,t; scanf("%d",&n); memset(a,0,sizeof(a)); me 阅读全文
posted @ 2014-04-15 20:27 人艰不拆_zmc 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 非递归时,貌似效率最高,数据小时效率差不多! 非递归模板: 递归模板: 2.改进二分查找--若查找的元素出现多次查找第一次出现的位置 a56爆大奖在线娱乐们可以从第一次得代码中知道,上述代码不能确定查找到得元素的位置为第一次出现的位置。怎么确定查找的元素在该序列中出现的是第一次呢,a56爆大奖在线娱乐们举一个例: 数组:1 2 3 3 阅读全文
posted @ 2014-04-15 20:25 人艰不拆_zmc 阅读(228) 评论(0) 推荐(0) 编辑
上一页 1 ··· 67 68 69 70 71