上一页 1 2 3 4 5 6 7 8 9 10 ··· 19 下一页
摘要: Problem DescriptionAn 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 are the same, that each code has at least 阅读全文
posted @ 2013-08-09 20:34 forevermemory 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Problem Description在一个奇怪的村子中,很多人的名字都很长,比如aaaaa, bbb and abababab。名字这么长,叫全名显然起来很不方便。所以村民之间一般只叫名字的前缀。比如叫\'aaaaa\'的时候可以只叫\'aaa\',因为没有第二个人名字的前三个字母是\'aaa\'。不过你不能叫\'a\',因为有两个人的名字都以\'a\'开头。村里的人都很聪明,他们总是用最短的称呼叫人。输入保证村里不会有一个人的名字是另外一个人名字的前缀(作为推论,任意两个人的名字都不会相同)。如果村里的某个人要 阅读全文
posted @ 2013-08-08 00:12 forevermemory 阅读(1554) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionMirko doesn’t like Latin homeworks so he made a bet with Slavko. Loser will be writing homeworks for both of them the entire month. Mirko wants to win so he designed this problem they could have something to bet on.At his desk he found a cube, with numbers 1 to 6 on its faces. Cub 阅读全文
posted @ 2013-08-07 11:24 forevermemory 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Problem Description地理学家们经常要对一段河流进行测量分析。他们从上游开始向下游方向等距离地选择了n(int dp[30005][101];int a[30005];int main(){ int i,n,test,j,k,x,ma; scanf("%d",&test); while(test--) { scanf("%d%d",&n,&k); for(i=0;i=0&&xma) ma=dp[i][j]; } } printf("%d\n",ma); } retu... 阅读全文
posted @ 2013-08-07 11:05 forevermemory 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N#include#includeint n;int cnt;int arr[15];bool is(int s){ int i; for(i=0;i=n) { cnt++; return; } for(i=0;i<n;i++) { arr[k]=i; ... 阅读全文
posted @ 2013-08-07 09:16 forevermemory 阅读(187) 评论(1) 推荐(0) 编辑
摘要: Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of first circle should always be 1.Inputn (0 #include#includeint n;int arr[20];int vis 阅读全文
posted @ 2013-08-05 16:26 forevermemory 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Problem Description=== Op tech briefing, 2002/11/02 06:42 CST ==="The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in World War II. Fortunately old Brumbaugh from rese 阅读全文
posted @ 2013-08-05 16:23 forevermemory 阅读(234) 评论(0) 推荐(0) 编辑
摘要: In Zhejiang University, there are N different courses labeled from 1 to N. Each course has its own time slot during the week. We can represent the time slot of a course by an left-closed right-open interval [s, t).Now we are going to arrange the final exam time of all the courses.The final exam peri 阅读全文
posted @ 2013-08-05 10:50 forevermemory 阅读(274) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 frame with one tile missing. Let's call the missing tile ' 阅读全文
posted @ 2013-08-02 16:47 forevermemory 阅读(637) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionLet's play a card game called Gap. You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 to 7) represents the value of the card.First, you shu2e the cards and lay them face up on the table 阅读全文
posted @ 2013-07-31 12:11 forevermemory 阅读(255) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 19 下一页