07 2015 档案

摘要:Let us consider sets of positive integers less than or equal to n. Note that all elements of a set are different. Also note that the order of elements... 阅读全文
posted @ 2015-07-31 22:12 心向晴 阅读(542) 评论(0) 推荐(0)
摘要:DescriptionToday on a lecture about strings Gerald learned a new definition of string equivalency. Two stringsaandbof equal length are calledequivalen... 阅读全文
posted @ 2015-07-31 21:18 心向晴 阅读(422) 评论(0) 推荐(0)
摘要:DescriptionThere is a piece of paper in front of Tom, its length and width are integer. Tom knows the area of this paper, he wants to know the minimum... 阅读全文
posted @ 2015-07-31 19:53 心向晴 阅读(394) 评论(0) 推荐(0)
摘要:DescriptionAndrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.Once he thoug... 阅读全文
posted @ 2015-07-31 19:44 心向晴 阅读(204) 评论(0) 推荐(0)
摘要:DescriptionA ring is composed of n (even number) circles as shown in diagram. Put natural numbersinto each circle separately, and the sum of numbers i... 阅读全文
posted @ 2015-07-31 19:35 心向晴 阅读(191) 评论(0) 推荐(0)
摘要:Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空... 阅读全文
posted @ 2015-07-31 19:17 心向晴 阅读(2191) 评论(0) 推荐(0)
摘要:DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular... 阅读全文
posted @ 2015-07-30 10:24 心向晴 阅读(297) 评论(0) 推荐(0)
摘要:Description给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格.Input第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n using namespace std;int main(){ int t,n,m,... 阅读全文
posted @ 2015-07-30 10:09 心向晴 阅读(289) 评论(0) 推荐(0)
摘要:Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of the maximum positive product involving consecutive te... 阅读全文
posted @ 2015-07-30 10:05 心向晴 阅读(414) 评论(0) 推荐(0)
摘要:DescriptionWrite a program that finds and displays all pairs of 5-digit numbers that between them use the digits0through9once each, such that the firs... 阅读全文
posted @ 2015-07-30 09:54 心向晴 阅读(10225) 评论(0) 推荐(0)
摘要://把一个x进制的数转成一个十进制的数#include #include using namespace std;char a[100];int main(){ int T,x; cin>>T>>x; while(T--) { cin>>a; int n=0; for(int i=0;i... 阅读全文
posted @ 2015-07-25 14:51 心向晴 阅读(140) 评论(0) 推荐(0)
摘要:DescriptionA magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the sys... 阅读全文
posted @ 2015-07-25 14:39 心向晴 阅读(393) 评论(0) 推荐(0)
摘要:某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人... 阅读全文
posted @ 2015-07-25 14:01 心向晴 阅读(509) 评论(0) 推荐(0)
摘要:Two bored soldiers are playing card war. Their card deck consists of exactlyncards, numbered from1ton,all values are different. They divide cards betw... 阅读全文
posted @ 2015-07-25 13:33 心向晴 阅读(161) 评论(0) 推荐(0)
摘要:DescriptionYou are given a string consisting of parentheses()and[]. A string of this type is said to becorrect:(a)if it is the empty string(b)if A and... 阅读全文
posted @ 2015-07-23 10:18 心向晴 阅读(197) 评论(0) 推荐(0)
摘要:10391 Compound WordsYou are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the ... 阅读全文
posted @ 2015-07-22 19:47 心向晴 阅读(324) 评论(0) 推荐(0)
摘要:10763 Foreign ExchangeYour non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign... 阅读全文
posted @ 2015-07-22 18:55 心向晴 阅读(256) 评论(0) 推荐(0)
摘要:10935 Throwing cards awayI Given is an ordered deck of n cards numbered 1 to n with card 1 at the top and card n at the bottom. The following operatio... 阅读全文
posted @ 2015-07-22 17:14 心向晴 阅读(754) 评论(0) 推荐(0)
摘要:Description费马大定理:当n>2时,不定方程an+bn=cn没有正整数解。比如a3+b3=c3没有正整数解。为了活跃气氛,我们不妨来个搞笑版:把方程改成a3+b3=c3,这样就有解了,比如a=4, b=9, c=79时43+93=793。输入两个整数x, y,求满足x#include us... 阅读全文
posted @ 2015-07-22 16:45 心向晴 阅读(414) 评论(0) 推荐(0)
摘要:Description“订外卖就上XXX,满X减Y,满X减Y...”这样的声音老回荡在我们耳旁。发传单,拉条幅的宣传手段也屡见不鲜。外卖的撕‘哔’大战充满血雨腥风,不过作为消费者,我们的问题是:“已知N种类似满X减Y的优惠,请问你想点M次外卖,最少出多少钱呢?”。(P.S:各优惠不能叠加,外卖不能拼... 阅读全文
posted @ 2015-07-22 16:23 心向晴 阅读(218) 评论(0) 推荐(0)
摘要:DescriptionIn a city there arenbus drivers. Also there arenmorning bus routes &nafternoon bus routes with various lengths. Each driver is assigned one... 阅读全文
posted @ 2015-07-17 21:19 心向晴 阅读(217) 评论(0) 推荐(0)
摘要:DescriptionMohammad has recently visitedSwitzerland. As he loves his friends very much, he decided to buy some chocolate for them, but as this fine ch... 阅读全文
posted @ 2015-07-17 20:30 心向晴 阅读(410) 评论(0) 推荐(0)
摘要:DescriptionAge Sort:You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that coun... 阅读全文
posted @ 2015-07-17 20:04 心向晴 阅读(398) 评论(0) 推荐(0)
摘要:DescriptionA soldier wants to buywbananas in the shop. He has to paykdollars for the first banana,2kdollars for the second one and so on (in other wor... 阅读全文
posted @ 2015-07-17 19:33 心向晴 阅读(228) 评论(0) 推荐(0)
摘要:Description从m个不同元素中取出n(n≤m)个元素的所有组合的个数,叫做从m个不同元素中取出n个元素的组合数。组合数的计算公式如下:C(m,n) =m!/((m-n)!n!)现在请问,如果将组合数C(m,n)写成二进制数,请问转这个二进制数末尾有多少个零。Input第一行是测试样例的个数T... 阅读全文
posted @ 2015-07-17 18:50 心向晴 阅读(594) 评论(0) 推荐(0)
摘要:DescriptionOnce upon a time, there is a special coco-cola store. If you return three empty bottles to the shop, you’ll get a full bottle of coco-cola ... 阅读全文
posted @ 2015-07-17 17:16 心向晴 阅读(942) 评论(0) 推荐(0)
摘要:Description把十进制整数转换为十六进制,格式为0x开头,10~15由大写字母A~F表示。Input每行一个整数x,0int main(){ int x; while(scanf("%d",&x)!=EOF) { printf("0x"); printf("%.8X\n",x); } ret... 阅读全文
posted @ 2015-07-17 16:51 心向晴 阅读(317) 评论(0) 推荐(0)
摘要:Description有三户人家共拥有一座花园,每户人家的太太均需帮忙整理花园。A 太太工作了5 天,B 太太则工作了4 天,才将花园整理完毕。C 太太因为正身怀六甲无法加入她们的行列,便出了90元。请问这笔钱如何分给A、B 二位太太较为恰当?A 应得多少元?90/(5+4)*5=$50 元?如果这... 阅读全文
posted @ 2015-07-17 16:26 心向晴 阅读(235) 评论(0) 推荐(0)
摘要:DescriptionVanya gotncubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must co... 阅读全文
posted @ 2015-07-17 15:59 心向晴 阅读(365) 评论(0) 推荐(0)
摘要:DescriptionThere is a permutation without two numbers in it, and now you know what numbers the permutation has. Please find the two numbers it lose.In... 阅读全文
posted @ 2015-07-17 15:26 心向晴 阅读(772) 评论(0) 推荐(0)