摘要: 快过年了,当然还是要刷题。题目好长,看了看翻译,英语水平拙计啊。把Strong的hint抛去,然后记录其他数字出现的次数,累加相同数字中最小的,不错的算法!题目:Master-Mind HintsMaster-Mind HintsMasterMind is a game for two players. One of them, Designer, selects a secret code. The other, Breaker, tries to break it. A code is no more than a row of colored dots. At the beginning 阅读全文
posted @ 2013-02-08 17:55 上白泽慧音 阅读(520) 评论(0) 推荐(0) 编辑
摘要: big number的收关题,自己的思路过于复杂,所以看了题解,感觉题目出的宽泛,除数可以用long存下来就省了很多麻烦。加减乘用bign完全没得问题,但是高精度的除法一直不知道快捷的算法是什么?题目:Problem C: If We Were a Child Again Shahriar Manzoor Shahriar Manzoor 17 81 2003-04-21T02:22:00Z 2003-05-20T08:54:00Z 2 242 1382 BUET 11 2 1697 9.2720 Print Problem CIfWe Were ... 阅读全文
posted @ 2013-02-07 19:08 上白泽慧音 阅读(615) 评论(0) 推荐(0) 编辑
摘要: 回老家玩了两天,回来先把没做完的题A了。一看输出就想起是poj的第二题哈(第一道A+B),当时看不太会,现在总算研究出来了。虽然是浮点运算但也能看成bign类型。细节地方稍加处理就行了。发现个问题,这个代码过不去poj1001。有待解决!!题目:Exponentiation ExponentiationProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national de 阅读全文
posted @ 2013-02-03 20:30 上白泽慧音 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 高精度运算,涉及加法、乘法和比大小。一不留神就写了百行,WA的原因是output没有把输入再打印一遍。不过改的时候也考虑了一下前导零,用了clean()函数。可能不考虑也能A,题里面又没说嘛。题目:OverflowOverflowWrite a program that reads an expression consisting of twonon-negative integer and an operator. Determine if either integer orthe result of the expression is too large to be represented 阅读全文
posted @ 2013-01-29 21:54 上白泽慧音 阅读(469) 评论(0) 推荐(0) 编辑
摘要: 高精度乘法题目:ProductProductThe ProblemThe problem is to multiply two integers X, Y. (0<=X,Y<10250)The InputThe input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.The OutputFor each input pair of lines the output line should consist one integer the product.Sampl 阅读全文
posted @ 2013-01-29 15:34 上白泽慧音 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 一道高精度加法运算,原来做过两道相似的。不过看了书之后还是尝试用了一下模板,套用标准C还是出现了一点问题。加法函数的时候竟然会把全局定义的结构变量值清空。题目:Integer InquiryInteger InquiryOne of the first users of BIT's new supercomputer was Chip Diller. Heextended his explorationof powers of 3 to go from 0 to 333 and he explored taking various sumsof those numbers.``This 阅读全文
posted @ 2013-01-29 01:15 上白泽慧音 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 来自刘汝佳的书/****************************************************/#include #include #include #include #include #include #include #include #include #define EPS 1E-8using namespace std;typedef long long LL;/****************************************************/ const int maxn = 200; struct bign{ int len, s. 阅读全文
posted @ 2013-01-28 23:03 上白泽慧音 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 字符串类型的收关题,1A。哎,小小总结一下吧。遇到字符串的题,甭多想,一定要用string库。自己编错的概率超大。还有就是标准输入输出。gets(),puts(),printf(),scanf(),getchar(),putchar()...一定要注意他们的区别和用法。常见要用的函数:strlen():我很少用吧,不过确实很常用。我一般还是判断'\0'。strcmp():超级有用,省了不少麻烦。strcpy()&memcpy():两个搭配使用。strcat():懒人必备吧,其实自己也可以编出来。strstr():过去一直忽视的函数,不过作为查找的确很好使。题目:Prob 阅读全文
posted @ 2013-01-28 20:16 上白泽慧音 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 没啥难度,一个一个比呗。题目:Immediate Decodability Immediate DecodabilityAn encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in binary, that no two codes within a set of codes 阅读全文
posted @ 2013-01-28 10:37 上白泽慧音 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 终于1A一次了,好爽。不过在c下还是用qsort()比较保险,用sort()死活套不上二维数组。用getchar读入逐个单词,在前面做过一道相似的。还有就是cmp函数,要加const,不然排序的时候把指针也交换了,虽然具体原理暂时不懂吧。前几天找同学耍了两天,今天开始进入刷题节奏吧 QAQ题目: Problem B: Andy's First DictionaryTime limit: 3 secondsAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task 阅读全文
posted @ 2013-01-27 23:13 上白泽慧音 阅读(2016) 评论(0) 推荐(0) 编辑