上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: 一、题目大意 有价值为1,2,3,4,5,6的六种大理石,它的数量不一。要在不破坏大理石的情况下,使两人能分到总价值相等的大理石。数量由标准输入给出,问给定数据能否平分。二、题解 首先,我们要的是平分总价值为两份,这里有一个很明显的剪枝,即如果总价值为奇数则直接输出不可分。如果总价值为偶数,则要把它... 阅读全文
posted @ 2013-08-10 11:21 InkGenius 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there... 阅读全文
posted @ 2013-08-09 22:51 InkGenius 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionIt is said that 90% of frosh expect to be above average in their class. You are to provide a reality check.InputThe first line of standar... 阅读全文
posted @ 2013-08-09 00:44 InkGenius 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 问题描述任意给定一个32位无符号整数n,求n的二进制表示中1的个数,比如n = 5(0101)时,返回2,n = 15(1111)时,返回4这也是一道比较经典的题目了,相信不少人面试的时候可能遇到过这道题吧,下面介绍了几种方法来实现这道题,相信很多人可能见过下面的算法,但我相信很少有人见到本文中所有... 阅读全文
posted @ 2013-08-06 15:55 InkGenius 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 一、Description国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。如下图所示: 王、后、车、象的走子规则如下: 王:横、直、斜都可以走,但每步限走一格。 后:横、直、斜都可以走,每步格数不受限制。 车:横、竖均可以走,不能斜走,格数不限。 象:只能斜走,格数不限。写一个程序,给... 阅读全文
posted @ 2013-08-05 14:48 InkGenius 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series'... 阅读全文
posted @ 2013-08-04 19:46 InkGenius 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionWrite a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per line) from the in... 阅读全文
posted @ 2013-08-04 19:15 InkGenius 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionThe most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (thi... 阅读全文
posted @ 2013-08-04 11:59 InkGenius 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionFarmer John made a profit last year! He would like to invest it well but wonders how much money he will make. He knows the interest rate ... 阅读全文
posted @ 2013-08-03 22:00 InkGenius 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionA numeric sequence of ai is ordered ifa1 z[i][j-1] ?z[i-1][j]:z[i][j-1]; } } return z[n][n]; ... 阅读全文
posted @ 2013-08-02 10:02 InkGenius 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionA military contractor for the Department of Defense has just completed a series of preliminary tests for a new defensive missile called t... 阅读全文
posted @ 2013-08-02 09:58 InkGenius 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionThe world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is ve... 阅读全文
posted @ 2013-08-02 09:47 InkGenius 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 最长递增子序列(Longest Increasing Subsequence) ,我们简记为 LIS。题:求一个一维数组arr[i]中的最长递增子序列的长度,如在序列1,-1,2,-3,4,-5,6,-7中,最长递增子序列长度为4,序列为1,2,4,6。解法一:快速排序+LCS 刚开始做这道题的时候... 阅读全文
posted @ 2013-08-01 22:57 InkGenius 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 广度优先搜索算法(Breadth-First-Search),又译作宽度优先搜索,或横向优先搜索,简称BFS,是一种图形搜索算法。简单的说,BFS是从根节点开始,沿着树的宽度遍历树的节点。如果所有节点均被访问,则算法中止。原理:从算法的观点,所有因为展开节点而得到的子节点都会被加进一个先进先出的队列... 阅读全文
posted @ 2013-07-31 23:46 InkGenius 阅读(976) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he ... 阅读全文
posted @ 2013-07-31 22:19 InkGenius 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页