12 2007 档案

HDU1015 Safecracker
摘要:简单的枚举法应用 阅读全文

posted @ 2007-12-30 17:14 Phinecos(洞庭散人) 阅读(1279) 评论(1) 推荐(0) 编辑

HDU1014 Uniform Generator
摘要:产生伪随机数时给出的步长step和上限mod,判断下这两个值是否可以让产生的随机数均匀分布,所谓的均匀分布就是在mod步里能产生出0到mod-1这mod个数。 阅读全文

posted @ 2007-12-29 09:44 Phinecos(洞庭散人) 阅读(1132) 评论(0) 推荐(0) 编辑

HDU1013 Digital Roots
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1013 #include #include using namespace std; void DigitRoot(int n) { int tmp; int sum = 0; while (n!=0) { tmp = n%10; sum += tmp; n = n/10;... 阅读全文

posted @ 2007-12-28 13:03 Phinecos(洞庭散人) 阅读(1166) 评论(1) 推荐(0) 编辑

HDU1007 Quoit Design
摘要:最接近点对问题,分治算法的应用 阅读全文

posted @ 2007-12-26 15:26 Phinecos(洞庭散人) 阅读(3148) 评论(2) 推荐(0) 编辑

HDU1012 Calculate e
摘要:使用递归和非递归两种方法进行求解 阅读全文

posted @ 2007-12-25 12:59 Phinecos(洞庭散人) 阅读(972) 评论(0) 推荐(0) 编辑

HDU1010 Tempter of the Bone
摘要:古人云:“由简入奢易,由奢入简难”,咱写代码也是一样,不求最快,但求最繁,繁得让你都不忍读完它。。。。 阅读全文

posted @ 2007-12-24 16:30 Phinecos(洞庭散人) 阅读(1502) 评论(2) 推荐(0) 编辑

HDU1009 FatMouse' Trade
摘要:简单的贪心算法 阅读全文

posted @ 2007-12-24 10:41 Phinecos(洞庭散人) 阅读(967) 评论(0) 推荐(0) 编辑

HDU1008 Elevator
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1008 #include using namespace std; int main(int argc, char *argv[]) { int n,curLev,desLev,sumTime,tmp; while(cin>>n&&n!=0) { curLev = 0;//初始层为0 sumTim... 阅读全文

posted @ 2007-12-23 22:29 Phinecos(洞庭散人) 阅读(487) 评论(0) 推荐(0) 编辑

HDU1004 Let the Balloon Rise
摘要:两次遍历map容器,算法复杂度O(n) 阅读全文

posted @ 2007-12-23 14:44 Phinecos(洞庭散人) 阅读(2064) 评论(5) 推荐(0) 编辑

HDU1003 最大子序列和问题
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1003 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include using namespace std; in... 阅读全文

posted @ 2007-12-23 13:47 Phinecos(洞庭散人) 阅读(2384) 评论(3) 推荐(0) 编辑

HDU1002 大数相加
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1002 #include #include using namespace std; void Add(string a,string b,char sum[],int& count) {//大数加法 int len1 = a.length();//数a的长度 int len2 = ... 阅读全文

posted @ 2007-12-22 23:10 Phinecos(洞庭散人) 阅读(1561) 评论(1) 推荐(0) 编辑

C++ Exercises(七)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include #include #include using namespace std;template void deSelSort(T arr[],int n){//双端选择排... 阅读全文

posted @ 2007-12-21 12:53 Phinecos(洞庭散人) 阅读(485) 评论(0) 推荐(0) 编辑

《Introduction to Computing Systems:From Bits and Gates to C and Beyond》读后感(一)
摘要:两个理念: 1)抽象。例如先基于晶体管描述逻辑门的实现,一旦领会了逻辑门的抽象,就将其细节丢弃,而是将其视为已经可以直接使用的组件,只有在系统出现问题时,才返回到细节中去进行分析 2)软硬件不加以区分。具体功能到底由谁来实现,以及两者之间的协作,依据的原则只是如何让计算机工作得更好, 图灵机以及图灵解决的问题:计算的可定义性 机器视角来看:从最底层的器件(最终是电子运动),接着是逻辑门电... 阅读全文

posted @ 2007-12-18 10:26 Phinecos(洞庭散人) 阅读(2259) 评论(2) 推荐(0) 编辑

An introduction to bitwise operators
摘要:读了codeproject上的这篇《An introduction to bitwise operators》,前面两个运算符说得不错,但第三个异或运算符感觉不够准确,作者给出的示例不知道有什么用处,不就是把数做了两次异或又回来了么? &运算符用来判定某些位是0还是1: #include using namespace std;int main(void){ int num = 17; ... 阅读全文

posted @ 2007-12-15 20:37 Phinecos(洞庭散人) 阅读(364) 评论(0) 推荐(0) 编辑

导航