摘要: 1031: [JSOI2007]字符加密CipherTime Limit: 10 SecMemory Limit: 162 MBSubmit: 1379Solved: 529[Submit][Status][Discuss]Description喜欢钻研问题的JS 同学,最近又迷上了对加密方法的思考。一天,他突然想出了一种他认为是终极的加密办法:把需要加密的信息排成一圈,显然,它们有很多种不同的读法。例如下图,可以读作:JSOI07SOI07JOI07JSI07JSO07JSOI7JSOI0把它们按照字符串的大小排序:07JSOI7JSOI0I07JSOJSOI07OI07JSSOI07J读出 阅读全文
posted @ 2013-03-06 23:48 cssystem 阅读(1235) 评论(0) 推荐(0)
摘要: 取石子游戏Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 29951Accepted: 9814Description有 两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆 中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是 败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子的数目,a和b都 阅读全文
posted @ 2013-02-22 19:22 cssystem 阅读(1759) 评论(0) 推荐(0)
摘要: Box RelationsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 270 Accepted Submission(s): 108 Problem Description There are n boxes C1, C2, ..., Cn in 3D space. The edges of the boxes are parallel to the x, y or z-axis. We provide ... 阅读全文
posted @ 2013-02-21 11:36 cssystem 阅读(104) 评论(0) 推荐(0)
摘要: Safe Or UnsafeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 90 Accepted Submission(s): 50 Problem Description Javac++ 一天在看计算机的书籍的时候,看到了一个有趣的东西!每一串字符都可以被编码成一些数字来储存信息,但是不同的编码方式得到的储存空间是不一样的!并且当储存空间大于一定的值的时候是不安全的!所以Javac++ 就想是否有一种方式... 阅读全文
posted @ 2013-02-20 22:20 cssystem 阅读(202) 评论(0) 推荐(0)
摘要: EntropyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 189 Accepted Submission(s): 110 Problem Description An entropy encoder is a data encoding method that achieves lossless data compression by encoding a message with “wasted” or... 阅读全文
posted @ 2013-02-20 22:18 cssystem 阅读(177) 评论(0) 推荐(0)
摘要: Stock ChaseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 207 Accepted Submission(s): 64 Problem Description I have to admit, the solution I proposed last year for solving the bank cash crisis didn’t solve the whole economic cris... 阅读全文
posted @ 2013-02-20 22:12 cssystem 阅读(199) 评论(0) 推荐(0)
摘要: 确定比赛名次Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 206 Accepted Submission(s): 118 Problem Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在... 阅读全文
posted @ 2013-02-20 11:35 cssystem 阅读(179) 评论(0) 推荐(0)
摘要: 统计难题Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 207 Accepted Submission(s): 126 Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每... 阅读全文
posted @ 2013-02-17 11:41 cssystem 阅读(168) 评论(0) 推荐(0)
摘要: 第一章:Recurrent Problems三个例题:THE TOWER OF HANOI、1.2 LINES IN THE PLANE、THE JOSEPHUS PROBLEM很有意思,讲的很好!三个都是递推问题,我学了以后,感触很深,现在就讲讲本蒟蒻的心得吧~汉诺塔问题:一个递推,原本的很简单,关键是例题的变种!LINES IN THE PLANE给你n条直线,问这n条直线最多可将平面划分为多少个区域?书上告诉我们,我们应该先从小数据开始。L0=1这是显然的,L1=2,L2=4,这些都能很快地得出。于是我们开始想,我们应该怎么样切第n刀,能将形成的用n-1刀切成的平面增加的更多?经过简单的 阅读全文
posted @ 2013-02-15 22:54 cssystem 阅读(529) 评论(0) 推荐(0)
摘要: Hat’s WordsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 135 Accepted Submission(s): 61 Problem Description A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are ... 阅读全文
posted @ 2013-02-15 11:42 cssystem 阅读(230) 评论(0) 推荐(0)
摘要: Segment setTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 120 Accepted Submission(s): 54 Problem Description A segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of... 阅读全文
posted @ 2013-02-15 10:59 cssystem 阅读(268) 评论(0) 推荐(0)
摘要: How Many Answers Are WrongTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 283 Accepted Submission(s): 134 Problem Description TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing ... 阅读全文
posted @ 2013-02-15 10:03 cssystem 阅读(183) 评论(0) 推荐(0)
摘要: Zjnu StadiumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 152 Accepted Submission(s): 65 Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a mod... 阅读全文
posted @ 2013-02-15 09:59 cssystem 阅读(152) 评论(0) 推荐(0)
摘要: Virtual FriendsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 194 Accepted Submission(s): 62 Problem Description These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends... 阅读全文
posted @ 2013-02-14 18:35 cssystem 阅读(222) 评论(0) 推荐(0)
摘要: Junk-Mail FilterTime Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 181 Accepted Submission(s): 62 Problem Description Recognizing junk mails is a tough task. The method used here consists of two steps:1) Extract the common character... 阅读全文
posted @ 2013-02-14 17:35 cssystem 阅读(185) 评论(0) 推荐(0)
摘要: Dragon BallsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 324 Accepted Submission(s): 154 Problem Description Five hundred years later, the number of dragon balls will increase unexpectedly, so it\\\\\\\'s too difficult for Monk... 阅读全文
posted @ 2013-02-14 12:24 cssystem 阅读(254) 评论(0) 推荐(0)
摘要: Riding the Fences Farmer John owns a large number of fences that must be repairedannually. He traverses the fences by riding a horse along each andevery one of them (and nowhere else) and fixing the broken parts. Farmer John is as lazy as the next farmer and hates to ride the samefence twice. You... 阅读全文
posted @ 2013-02-13 20:12 cssystem 阅读(210) 评论(0) 推荐(0)
摘要: Sweet ButterGreg Galperin -- 2001Farmer John has discovered the secret to making the sweetest butter in all of Wisconsin: sugar. By placing a sugar cube out in the pastures, he knows the N (1 <= N <= 500) cows will lick it and thus will produce super-sweet butter which can be marketed at bette 阅读全文
posted @ 2013-02-13 16:17 cssystem 阅读(452) 评论(0) 推荐(0)
摘要: Magic SquaresIOI'96Following the success of the magic cube, Mr. Rubik invented its planarversion, called magic squares. This is a sheet composed of 8 equal-sizedsquares:12348765 In this task we consider the version where each square has a differentcolor. Colors are denoted by the first 8 positiv 阅读全文
posted @ 2013-02-13 12:50 cssystem 阅读(327) 评论(0) 推荐(0)
摘要: Feed Ratios1998 ACM Finals, Dan Adkins Farmer John feeds his cows only the finest mixture of cow food,which has three components: Barley, Oats, and Wheat. While he knowsthe precise mixture of these easily mixable grains, he can not buy thatmixture! He buys three other mixtures of the three grain... 阅读全文
posted @ 2013-02-13 10:34 cssystem 阅读(265) 评论(0) 推荐(0)
摘要: Spinning Wheels1998 ACM NE Regionals Each of five opaque spinning wheels has one or more wedges cutout of its edges. These wedges must be aligned quickly and correctly.Each wheel also has an alignment mark (at 0 degrees) so that thewheels can all be started in a known position. Wheels rotate inth... 阅读全文
posted @ 2013-02-13 00:13 cssystem 阅读(419) 评论(0) 推荐(0)
摘要: StringsobitsKim Schrijvers Consider an ordered set S of strings of N (1 <= N <= 31)bits. Bits, of course, are either 0 or 1. This set of strings is interesting because it is ordered andcontains all possible strings of length N that have L (1 <= L<= N) or fewer bits that are `1'. Your 阅读全文
posted @ 2013-02-12 22:06 cssystem 阅读(328) 评论(0) 推荐(0)
摘要: Shaping RegionsN opaque rectangles (1 <= N <= 1000) of various colors are placed on a white sheet of paper whose size is A wide by B long. The rectangles are put with their sides parallel to the sheet's borders. All rectangles fall within the borders of the sheet so that different figures 阅读全文
posted @ 2013-02-11 19:05 cssystem 阅读(235) 评论(0) 推荐(0)
摘要: ContactIOI'98The cows have developed a new interest in scanning the universeoutside their farm with radiotelescopes. Recently, they noticed a verycurious microwave pulsing emission sent right from the centre of thegalaxy. They wish to know if the emission is transmitted by someextraterrestrial f 阅读全文
posted @ 2013-02-10 17:56 cssystem 阅读(343) 评论(0) 推荐(0)
摘要: Stamps Given a set of N stamp values (e.g., {1 cent, 3 cents}) and an upperlimit K to the number of stamps that can fit on an envelope, calculate thelargest unbroken list of postages from 1 cent to M cents that can becreated. For example, consider stamps whose values are limited to 1 cent and 3cent. 阅读全文
posted @ 2013-02-10 12:18 cssystem 阅读(260) 评论(0) 推荐(0)
摘要: Is It A Tree?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 480 Accepted Submission(s): 174 Problem Description A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes con... 阅读全文
posted @ 2013-02-08 12:11 cssystem 阅读(193) 评论(0) 推荐(0)
摘要: A Bug's LifeTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 425 Accepted Submission(s): 159 Problem Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they featur... 阅读全文
posted @ 2013-02-08 12:07 cssystem 阅读(211) 评论(0) 推荐(0)
摘要: Humble Numbers For a given set of K prime numbers S = {p1, p2,..., pK}, consider the set of all numbers whose prime factors area subset of S. This set contains, for example, p1,p1p2, p1p1, andp1p2p3 (among others). This is the setof `humble numbers' for the input set S. Note: The number 1 is exp 阅读全文
posted @ 2013-02-06 19:42 cssystem 阅读(318) 评论(0) 推荐(0)
摘要: Score InflationThe more points students score in our contests, the happier we hereat the USACO are. We try to design our contests so that people can scoreas many points as possible, and would like your assistance. We have several categories from which problems can be chosen, wherea "category&qu 阅读全文
posted @ 2013-02-06 10:56 cssystem 阅读(237) 评论(0) 推荐(0)
摘要: Agri-NetRuss Cox Farmer John has been elected mayor of his town! One of his campaignpromises was to bring internet connectivity to all farms in the area.He needs your help, of course. Farmer John ordered a high speed connection for his farm and isgoing to share his connectivity with the other farm.. 阅读全文
posted @ 2013-02-06 09:09 cssystem 阅读(343) 评论(0) 推荐(0)
摘要: Factorials The factorial of an integer N, written N!, is the product of allthe integers from 1 through N inclusive. The factorial quickly becomesvery large: 13! is too large to store in a 32-bit integer on mostcomputers, and 70! is too large for most floating-point variables. Yourtask is to find th. 阅读全文
posted @ 2013-01-31 11:24 cssystem 阅读(195) 评论(0) 推荐(0)
摘要: Fractions to Decimals Write a program that will accept a fraction of the form N/D, whereN is the numerator and D is the denominator and print the decimalrepresentation. If the decimal representation has a repeating sequenceof digits, indicate the sequence by enclosing it in brackets. For example,1.. 阅读全文
posted @ 2013-01-31 09:01 cssystem 阅读(433) 评论(0) 推荐(0)
摘要: Bessie Come HomeKolstad & BurchIt's dinner time, and the cows are out in their separate pastures.Farmer John rings the bell so they will start walking to the barn. Yourjob is to figure out which one cow gets to the barn first (the suppliedtest data will always have exactly one fastest cow).B 阅读全文
posted @ 2013-01-30 23:56 cssystem 阅读(335) 评论(0) 推荐(0)
摘要: Cow ToursFarmer John has a number of pastures on his farm. Cow pathsconnect some pastures with certain other pastures, forming a field.But, at the present time, you can find at least two pastures thatcannot be connected by any sequence of cow paths, thus partitioningFarmer John's farm into multi 阅读全文
posted @ 2013-01-30 23:10 cssystem 阅读(857) 评论(0) 推荐(0)
摘要: OverfencingKolstad and Schrijvers Farmer John went crazy and created a huge maze of fences out in afield. Happily, he left out two fence segments on the edges, and thuscreated two "exits" for the maze. Even more happily, the mazehe created by this overfencing experience is a `perfect' 阅读全文
posted @ 2013-01-30 23:06 cssystem 阅读(385) 评论(0) 推荐(0)
摘要: Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output 共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。 Sample Input1850 Sample Output19210 ... 阅读全文
posted @ 2013-01-03 19:55 cssystem 阅读(240) 评论(0) 推荐(0)
摘要: Problem DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had originally and how long they were originally. Please help him and design a program wh 阅读全文
posted @ 2013-01-02 12:05 cssystem 阅读(142) 评论(0) 推荐(0)
摘要: Description给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值,其中k mod i表示k除以i的余数。 例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5=0+1+0+3+3=7Input输入仅一行,包含两个整数n, k。Output输出仅一行,即j(n, k)。Sample Input5 3Sample Output7HINT 50%的数据满足:1<=n, k<=1000100%的数据满足:1<=n ,k<=10^9思路: 阅读全文
posted @ 2013-01-01 23:25 cssystem 阅读(381) 评论(0) 推荐(0)
摘要: Problem Description Search is important in the acm algorithm. When you want to solve a problem by using the search method, try to cut is very important.Now give you a number sequence, include n (<=100) integers, each integer not bigger than 2^31, you want to find the first P subsequences that is 阅读全文
posted @ 2012-12-29 23:03 cssystem 阅读(176) 评论(0) 推荐(0)
摘要: Problem Description蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也 跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随机的在一行上展开,编 号从1到10,把第i号上的牌移到第j号牌上,移动距离为abs(i-j),现在你要做的是求出完成游戏的最小移动距离。 Input 第一个输入数据是T,表示数据的组数。每组数据有一行,10个输入数据,数据的范围是[1,... 阅读全文
posted @ 2012-12-28 17:56 cssystem 阅读(246) 评论(0) 推荐(0)

点击右上角即可分享
微信分享提示