书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

2011年12月1日

给博客园的一些建议

摘要: 来园有3个月了,感觉在这里的感觉真的不错,特别是这里的管理员,真的很勤奋呀。对工作也十分的负责,令人佩服呀。然而,在使用的过程中也发现了小小的不足,下面提出来,供管理员们参考。原因:随着时间的推移,我写的文章也越来越多了,目前有119篇,而且还在以一定的速度增加,119篇是个什么概念呢?在博客园中是每10篇文章的标题分为一页的,那么我现在也就有12页了。文章多了,这是一件好事,但是找起来就不是一件容易的事了。众所周知,人总会忘的,所以,时不时的要回顾一下已经学过的知识,有时遇到了问题,也会去已经写过的文章中寻找答案……,所有这些原因就导致了要不停的去找已经写过的文章。但是,这么多文章找起来不方 阅读全文

posted @ 2011-12-01 22:49 More study needed. 阅读(1765) 评论(18) 推荐(4) 编辑

素数快速打表的方法

摘要: 素数这个东西在编程的时候经常用到,下面给出一种快速打出一定量素数的代码。View Code bool NotPrime[40005];long long Prime[40005];void init()//得到素数{ long long i,j,num=0; for(i=2;i<=40000;i++) //注意是从2开始的,直到你想要的范围。 { if(!NotPrime[i]) //如果不是不是素数(也就是说是素数了) { Prime[num++]=i; //将素数i存储在prime数组中。 for(... 阅读全文

posted @ 2011-12-01 21:58 More study needed. 阅读(409) 评论(0) 推荐(0) 编辑

字符指针变量数组的用法

摘要: 我们知道,char *s="aisdfj"; 是成立的。于是char *s[]={"one", "two", ……}也是成立的。就相当于把char *s看成另外一种类型的变量一样。其实,就这么简单。Sample Inputone + two =three four + five six =zero seven + eight nine =zero + zero =Sample Output39096View Code #include "stdio.h"#include "string.h"ch 阅读全文

posted @ 2011-12-01 16:14 More study needed. 阅读(237) 评论(0) 推荐(0) 编辑

BFS寻求最短距离

摘要: 题目:http://acm.swust.edu.cn/oj/problem/4/这是一道简单的题目,但是可以说明问题了。View Code #include "iostream"#include "string"#include "cstdio"#include "cstring"#include "algorithm"#include "queue"using namespace std;char Map[105][105];int Used[105][105];int D 阅读全文

posted @ 2011-12-01 12:14 More study needed. 阅读(277) 评论(0) 推荐(0) 编辑

DFS遍历整个连通的区域

摘要: DFS在搜索的过程中,可以搜索一大片的连通的区域。题目:http://acm.swust.edu.cn/oj/problem/1/View Code #include<iostream>#include<string.h>using namespace std;int direction[4][2] = {{-1,0},{1,0},{0,-1},{0,1}};int used[1005][85];char map[1005][85];int W, H, i, j, count, Max, tx, ty;void dfs(int i, int j){ int k; cou 阅读全文

posted @ 2011-12-01 12:11 More study needed. 阅读(302) 评论(0) 推荐(0) 编辑

导航

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!