- 博客(15)
- 收藏
- 关注
转载 (转载)菜鸟拼杀ZOJ心得:[ZZ]递归深度优先搜索
这面这篇文章,转自http://aaskywalker.spaces.live.com/blog/cns!AC69B568074FB91D!537.entry觉得挺不错的.刚好最近也在学习搜索算法.对于广度优先搜索,还是比较好理解的,对于深度的,我一直都不想去接触他,这篇文章确定写得很生动,转过来跟大家一起共享下,呵呵
2007-03-23 11:45:00
963
原创 I am exciting tonight
I thought I hadnt pass the cet-4, when i choice to take part in cet-6.to my suprise, it successes ,that means I had pass it ,hoho ~come on,,,,,,the next aim is get the first place in the ACM compet
2007-03-18 01:46:00
569
原创 zoj 2744
#includestdio.h>#includestdlib.h>#includestring.h> char a[5001]; int leng; int count ; void len(char *p) ...{ while(*p) ...{leng ++; p ++; } }void
2007-03-12 01:09:00
780
原创 zoj 1095 Humble Numbers
//code by wshong#includestdio.h>#includestdlib.h>int main()...{ int ham[5842]; int a[4]=...{0,0,0,0}; ham[0] = 1; int i; for(i = 1; i 5842; i++) ...{ int tem1 = 2 * ham[a[0
2007-03-02 15:28:00
1266
1
原创 zoj 1016 Parencodings
#includestdio.h>#includestdlib.h>int main()...{ char a[21]; int t; int n,m; int i,j; scanf("%d", &t); while(t--) ...{ scanf("%d", &n); ...{
2007-03-02 15:17:00
877
原创 zoj 2132 The Most Frequent Number
#includestdio.h>#includestdlib.h>int main()...{ long n; long m; while(scanf("%ld", &n)!= EOF) ...{ scanf("%ld",&m); long temp = m; long count = 1; int i;
2007-02-28 01:19:00
1082
原创 zoj 2421 Recaman's Sequence
//一次ac 算法很简单,题目已经给出,b[]是作为标记已有数用的,这样不用去搜,以空间换取时间 //zoj 2421 #include stdio.h>#include stdlib.h>#includestring.h>#define MAX 500000#define MAXA 5000000 int a[MAX],b[MAXA];int main()...{ int i;
2007-02-28 00:22:00
860
原创 zoj 1539 Lot
#includestdio.h>#includestdlib.h>int count(int n)...{ if(n == 3) return 1; else if(n 3) return 0; else if(n&1) ...{ return count(n/2) + count(n/2 + 1); } else .
2007-02-27 16:45:00
915
原创 zoj 2486 Power of Cryptography
#includestdio.h>#includestdlib.h>#includemath.h>int main()...{ double n,p; while(scanf("%lf%lf",&n,&p)!=EOF) ...{ double k = pow(p, 1.0/n); printf("%g ",k);
2007-02-26 11:01:00
790
原创 zoj 2185 Count on Canton
这是一道数学题,仔细观察有规律 #includestdio.h>#includestdlib.h>#includemath.h>int main()...{ long n; int i; while(scanf("%ld",&n)!=EOF) ...{ long m = (long)sqrt(2 * n); while(m
2007-02-25 17:52:00
901
原创 智力题
有7克、2克砝码各一个,天平一只,如何只用这些物品三次将140克的盐分成50、90克各一份?听说是微软的面试题,下面是我的解法:先利用等比例称出 40克的盐:先将7克的砝码和140克的盐放在天平两端,然后记下此刻的倾斜度; 再将2克的砝码代替原来的7克砝码,将原来的盐拿掉一些,知道刻度跟原来的一样 此时天平上的盐的质量应该是40克,此时砝码也用了两次,第三次。两边各方一
2007-02-10 14:03:00
808
1
原创 收集的一些ACM oj网站
Usaco: http://ace.delos.com/usacogateUral : http://acm.timus.ruUva : http://acm.uva.es/p/Poi : http://www.mimuw.edu.pl/oi/english/Ceoi : http://ceoi.inf.elte.hu/ ICPC: http://ICPC.BAYLOR.EDU
2007-02-09 00:55:00
3131
原创 pku 1003
这几天刚刚接触java,恰好pku的oj可以用java代码提交,所以找些hello world 的题目来练练这是我第一个除了hello world 的另外一个 hello world accepted~第一次还以为可以用while(1),没想到没有可以运行,后来问下人,才知道不像c中1 。常数不能作为条件判断 import java.util.*;public class
2007-02-06 11:42:00
740
原创 zju 1394
Polar ExplorerTime limit: 1 Seconds Memory limit: 32768K Total Submit: 1477 Accepted Submit: 400 IntroductionYou are a intrepid 2-dimensional explorer located at the northern polar reaches of
2007-02-05 11:21:00
1104
原创 blog开张,
今天 突然心血来潮,要开通优快云的blog,我决定用英语加中文写,用英语是因为我的英语水平很低,我要多点练习英语来提高自己,计算机方面的许多资料和文档都是用e文写的~翻译过来的东西也是各有所异,所以提高英文水平有助于对一些资料的更好理解,,,,,,, 才能真正的理解计算机
2006-12-28 11:00:00
513
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人