2010年12月20日

摘要: http://poj.org/problem?id=1051P,MTHBGWBTime Limit:1000MSMemory Limit:10000KTotal Submissions:5088Accepted:2924DescriptionMorse code represents characters as variable length sequences of dots and dashes. In practice, characters in a message are delimited by short pauses. The following table shows the 阅读全文
posted @ 2010-12-20 21:32 yming0221 阅读(244) 评论(0) 推荐(0)
摘要: 1.前言 GCC编译器的手册(GCC MANUAL)的英文版已经非常全面,并且结构也非常完善了,只是一直都没有中文的版本,我这次阅读了GCC编译器的主要内容,对手册的内容进行了结构性的了解,认为有必要对这次阅读的内容进行整理,为以后的工作做准备。 由于我对这个英文手册的阅读也仅仅是结构性的。因此有很多地方并没有看,所以这篇文档的内容我也只能写出部分,对于以后需要详细了解的地方,会再往这篇文档中增添内容,需要增添的内容主要是编译器的各种开关。2. GCC功能介绍 GCC编译器完成从C、C++、objective-C等源文件向运行在特定CPU硬件上的目标代码的转换(这是任何一个编译器需要完成的任务 阅读全文
posted @ 2010-12-20 20:15 yming0221 阅读(254) 评论(0) 推荐(0)
摘要: #include <stdio.h>#define MAX 100int len, sum;char list[MAX];static int perm(int k, int m);static int swap(int i, int j);int main(){ scanf("%s",list); len = strlen(list); sum = perm(0, len-1);//not include '/n' printf("sum = %d/n", sum); return 0;}static int perm(in 阅读全文
posted @ 2010-12-20 19:43 yming0221 阅读(151) 评论(0) 推荐(0)
摘要: double tmp; int is_prime(int n) { if(n % 2 == 0) return 0; int i; tmp=sqrt((double)n); for(i=3;i<=tmp;i+=2) if(n % i == 0) return 0; return 1; } 关于素数的算法是信息学竞赛和程序设计竞赛中常考的数论知识,在这里我跟大家讲一下寻找一定范围内素数的几个算法。看了以后相信 对大家一定有帮助。 正如大家都知道的那样,一个数n如果是合数,那么它的所有的因子不超过sqr... 阅读全文
posted @ 2010-12-20 18:55 yming0221 阅读(213) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=3126我的第一道BFS,WA了几次,TLE了几次,最后AC!Prime PathTime Limit:1000MSMemory Limit:65536KTotal Submissions:5022Accepted:2908DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room 阅读全文
posted @ 2010-12-20 17:32 yming0221 阅读(149) 评论(0) 推荐(0)

导航