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...
阅读全文
摘要:DescriptionToday on a lecture about strings Gerald learned a new definition of string equivalency. Two stringsaandbof equal length are calledequivalen...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空...
阅读全文
摘要:DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular...
阅读全文
摘要:Description给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格.Input第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n using namespace std;int main(){ int t,n,m,...
阅读全文
摘要:Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of the maximum positive product involving consecutive te...
阅读全文
摘要:DescriptionWrite a program that finds and displays all pairs of 5-digit numbers that between them use the digits0through9once each, such that the firs...
阅读全文
摘要://把一个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...
阅读全文
摘要:DescriptionA magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the sys...
阅读全文
摘要:某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人...
阅读全文
摘要:Two bored soldiers are playing card war. Their card deck consists of exactlyncards, numbered from1ton,all values are different. They divide cards betw...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要:10763 Foreign ExchangeYour non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Description“订外卖就上XXX,满X减Y,满X减Y...”这样的声音老回荡在我们耳旁。发传单,拉条幅的宣传手段也屡见不鲜。外卖的撕‘哔’大战充满血雨腥风,不过作为消费者,我们的问题是:“已知N种类似满X减Y的优惠,请问你想点M次外卖,最少出多少钱呢?”。(P.S:各优惠不能叠加,外卖不能拼...
阅读全文
摘要:DescriptionIn a city there arenbus drivers. Also there arenmorning bus routes &nafternoon bus routes with various lengths. Each driver is assigned one...
阅读全文
摘要:DescriptionMohammad has recently visitedSwitzerland. As he loves his friends very much, he decided to buy some chocolate for them, but as this fine ch...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Description从m个不同元素中取出n(n≤m)个元素的所有组合的个数,叫做从m个不同元素中取出n个元素的组合数。组合数的计算公式如下:C(m,n) =m!/((m-n)!n!)现在请问,如果将组合数C(m,n)写成二进制数,请问转这个二进制数末尾有多少个零。Input第一行是测试样例的个数T...
阅读全文
摘要: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 ...
阅读全文
摘要:Description把十进制整数转换为十六进制,格式为0x开头,10~15由大写字母A~F表示。Input每行一个整数x,0int main(){ int x; while(scanf("%d",&x)!=EOF) { printf("0x"); printf("%.8X\n",x); } ret...
阅读全文
摘要:Description有三户人家共拥有一座花园,每户人家的太太均需帮忙整理花园。A 太太工作了5 天,B 太太则工作了4 天,才将花园整理完毕。C 太太因为正身怀六甲无法加入她们的行列,便出了90元。请问这笔钱如何分给A、B 二位太太较为恰当?A 应得多少元?90/(5+4)*5=$50 元?如果这...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
浙公网安备 33010602011771号