自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(79)
  • 资源 (2)
  • 收藏
  • 关注

原创 D的小L

描述      一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0,,,聪明的你能帮匡匡解围吗?输入第一行输入一个数N(0输出按特定顺序输出所有组合。特定顺序:每一个组合中的值从小到大排列,组合之间按字典序排列。样例输入223样例输出1221

2015-07-07 19:34:04 506

原创 众数问题

描述所谓众数,就是对于给定的含有N个元素的多重集合,每个元素在S中出现次数最多的成为该元素的重数,多重集合S重的重数最大的元素成为众数。例如:S={1,2,2,2,3,5},则多重集S的众数是2,其重数为3。现在你的任务是:对于给定的由m个自然数组成的多重集S,计算出S的众数及其重数。输入第一行为n,表示测试数据组数。(n每组测试的第一行是一个整数m

2015-07-07 18:04:50 831

原创 比大小

描述给你两个很大的数,你能不能判断出他们两个数的大小呢?比如123456789123456789要大于-123456输入每组测试数据占一行,输入两个不超过1000位的10进制整数a,b数据保证输入的a,b没有前缀的0。如果输入0 0表示输入结束。测试数据组数不超过10组输出如果a>b则输出“a>b”,如果a样例输入11111111111111

2015-07-07 13:27:43 992

原创 聪明的kk

描述聪明的“KK”非洲某国展馆的设计灵感源于富有传奇色彩的沙漠中陡然起伏的沙丘,体现出本国不断变换和绚丽多彩的自然风光与城市风貌。展馆由五部分组成,馆内影院播放名为《一眨眼的瞬间》的宽银幕短片,反映了建国以来人民生活水平和城市居住环境的惊人巨变。可移动“沙丘”变戏法 的灵感源于其独特而雄伟的自然景观——富于传奇色彩的险峻沙丘。宏伟的结构、可循环的建材,与大自然相得益彰。环绕一周,发现它正是

2015-07-05 17:59:22 468 1

原创 蛇形填数

描述 在n*n方陈里填入1,2,...,n*n,要求填成蛇形。例如n=4时方陈为:10 11 12 19 16 13 28 15 14 37 6 5 4输入 直接输入方陈的维数,即n的值。(n输出 输出结果是蛇形方陈。 样例输入 3样例输出 7 8 16 9 25 4 3#include#include#includeusing names

2015-07-05 15:18:50 440

原创 卡片游戏

桌上有一叠牌,从第一张牌(即位于顶面的牌)开始从上往下依次编号为1~n。当至少还剩两张牌时进行以下操作:把第一张牌扔掉,然后把新的第一张放到整叠牌的最后。输入n,输出每次扔掉的牌,以及最后剩下的牌。输入:7输出:1 3 5 7 4 2 6 #include#includeusing namespace std;queue q;int main(){ int n; sc

2015-07-05 11:36:42 685

原创 01串

描述ACM的zyc在研究01串,他知道某一01串的长度,但他想知道不含有“11”子串的这种长度的01串共有多少个,他希望你能帮帮他。注:01串的长度为2时,有3种:00,01,10。输入第一行有一个整数n(0随后有n行,每行有一个整数m(2输出输出不含有“11”子串的这种长度的01串共有多少个,占一行。样例输入223样例输出3

2015-07-05 11:34:06 674

原创 超级台阶

描述有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第m级,共有多少走法?注:规定从一级到一级有0种走法。输入输入数据首先包含一个整数n(1输出对于每个测试实例,请输出不同走法的数量。样例输入223样例输出12来源[苗栋栋]原创上传者苗栋栋#include#includeusing namespace

2015-07-05 11:32:59 466

原创 The Triangle

描述73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the top and ends some

2015-07-05 11:28:44 459

原创 组合数

描述找出从自然数1、2、... 、n(0<n<10)中任取r(0<r<=n)个数的所有组合。输入输入n、r。输出按特定顺序输出所有组合。特定顺序:每一个组合中的值从大到小排列,组合之间按逆字典序排列。样例输入5 3样例输出543542541532531521432431421321//这是关于dfs的,刚开始的是觉得

2015-04-27 20:47:07 533

原创 Encoding

Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same characters should be encoded to "kX" where "X" i

2015-04-24 20:46:00 1053

原创 Least Common Multiple

Problem DescriptionThe least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 1

2015-04-24 20:43:39 383

原创 Digital Roots

Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resultin

2015-04-24 19:15:08 391

原创 Elevator

Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified

2015-04-24 11:23:30 605

原创 Quoit Design

Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyberground, the po

2015-04-24 10:52:03 526

原创 Number Sequence

Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n). I

2015-04-22 11:51:34 410

原创 Let the Balloon Rise

Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest i

2015-04-22 11:21:29 542

原创 Max Sum

Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +

2015-04-22 10:54:59 458

原创 Doing Homework again

DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the ho

2014-12-10 21:02:18 338

原创 Shopaholic

DescriptionLindsay is a shopaholic. Whenever there is a discount of the kind where you can buy three items and only pay for two, she goes completely mad and feels a need to buy all items in the st

2014-12-09 19:57:51 612

原创 A - FatMouse' Trade

DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains J

2014-12-09 11:57:49 596

原创 今年暑假不AC1

Description“今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级

2014-12-09 11:57:04 618

原创 素数

描述走进世博园某信息通信馆,参观者将获得前所未有的尖端互动体验,一场充满创想和喜悦的信息通信互动体验秀将以全新形式呈现,从观众踏入展馆的第一步起,就将与手持终端密不可分,人类未来梦想的惊喜从参观者的掌上展开。在等候区的梦想花园中,参观者便开始了他们奇妙的体验之旅,等待中的游客可利用手机等终端参与互动小游戏,与梦想剧场内的虚拟人物Kr. Kong 进行猜数比赛。当屏幕出现一个整数X时

2014-12-07 19:07:22 485

原创 Binary String Matching

描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a substring of B? For example, the text string B is ‘1001110110’ while

2014-12-07 18:46:00 303

原创 寻找最大数(三)

描述给出一个整数N,每次可以移动2个相邻数位上的数字,最多移动K次,得到一个新的整数。求这个新的整数的最大值是多少。输入多组测试数据。每组测试数据占一行,每行有两个数N和K (1 ≤ N≤ 10^18; 0 ≤ K ≤ 100).输出每组测试数据的输出占一行,输出移动后得到的新的整数的最大值。样例输入1990 1100 09090000078

2014-12-06 19:26:12 693

原创 下沙小面的(2)

Description前文再续,书接上一题。话说当上小面的司机的Lele在施行他的那一套拉客法则以后,由于走的路线太长,油费又贵,不久便亏本了。(真可怜~)于是他又想了一个拉客的办法。 对于每一次拉客活动,他一次性把乘客都拉上车(当然也不会超过7个,因为位置只有7个)。然后,Lele计算出一条路线(出于某些目的,Lele只把车上乘客的目的地作为这条路线上的站点),把所有乘客都送到目

2014-12-04 21:35:33 566

原创 +-字符串

描述Shiva得到了两个只有加号和减号的字符串,字串长度相同。Shiva一次可以把一个加号和它相邻的减号交换。他想知道最少需要多少次操作才能把第一个字符串变换成第二个字符串。你现在要去帮助他完成那个这个问题。输入多组测试数据每组数据有两行,每行包含一个由”+”和”-“最成的字符串。每个子符串长度不超过5000。输出仅一个整数,输出最少需要操作的次数。如果答案不存

2014-12-04 20:18:43 506

原创 寻找最大数

描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大,比如当n=92081346718538,m=10时,则新的最大数是9888 输入第一行输入一个正整数T,表示有T组测试数据每组测试数据占一行,每行有两个数n,m(n可能是一个很大的整数,但其位数不超过100位,并且保证数据首位非0,m小于整数n的位数)输出每组测试数据的输出占一行,输出剩余的数字按原

2014-12-02 21:21:21 598

原创 阶乘之和

描述 给你一个非负数整数n,判断n是不是一些数(这些数不允许重复使用,且为正数)的阶乘之和,如9=1!+2!+3!,如果是,则输出Yes,否则输出No;输入第一行有一个整数0每组测试数据有一个正整数n输出如果符合条件,输出Yes,否则输出No;样例输入2910样例输出YesNo#includeusing namesp

2014-12-02 20:19:47 680

原创 背包问题

描述现在有很多物品(它们是可以分割的),我们知道它们每个物品的单位重量的价值v和重量w(1<=v,w<=10);如果给你一个背包它能容纳的重量为m(10<=m<=20),你所要做的就是把物品装到背包里,使背包里的物品的价值总和最大。输入第一行输入一个正整数n(1随后有n测试数据,每组测试数据的第一行有两个正整数s,m(1输出输出每组测试数据中背包内的物品的价值和,每

2014-12-02 20:04:44 521

原创 求和求到手软

描述LN想要知道大家的小学数学好不好。现在他想让你求出几个数的和。你能搞定么?输入多组测试数据 一组测试数据一行。输出一个数sum,表示结果。(保证在 int 范围内)样例输入2 3 55 6 7 81 2 3 4 5 6 7 8 9 10样例输出102655代码如下这道题考察的点很清晰,就是对输入数据的处理。

2014-12-02 10:55:01 667

原创 An Easy Problem

描述    In this problem, you are given two integers L and R, and your task is to calculate the sum of all the number's square between L and R(inclusive).输入The first line contains an integer

2014-12-02 10:27:40 453

原创 括号配对问题

#include#includeint main(){ int n,t,low,high,i; char a[10000],s[10000]; scanf("%d",&n); while(n--) { scanf("%s",a); t=strlen(a); low=0; high=0; for(i=0;i<t;i++) { switch(a[i])

2014-11-27 21:24:42 537

原创 开方数

描述 现在给你两个数 n 和 p ,让你求出 p 的开 n 次方。输入每组数据包含两个数n和p。当n和p都为0时表示输入结束。(1输出对于每个输出对用输出开方后的结果k(结果小于10^9)。样例输入2 163 277 43571861840213822045440 0样例输出431234#include#include int

2014-11-27 21:03:28 504

原创 A+B Problem II

描述 I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.A,B must be positive.输入The first line of the input contains an integer T(1<=T<=20

2014-11-27 20:28:21 360

原创 大数阶乘

描述 我们都知道如何计算一个数的阶乘,可是,如果这个数很大呢,我们该如何去计算它并输出它?输入输入一个整数m(0输出输出m的阶乘,并在输出结束之后输入一个换行符样例输入50样例输出30414093201713378043612608166064768844377641568960512000000000000#includeusing n

2014-11-27 20:24:14 506

原创 Exponentiation

DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many

2014-11-26 21:26:12 474

原创 If We Were a Child Again

DescriptionThe Problem The first project for the poor student was to make a calculator that can just perform the basic arithmetic operations. But like many other university students he d

2014-11-25 21:26:56 549

原创 Product(大数相乘)

DescriptionThe problem is to multiply two integers X, Y. (0InputThe input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.OutputFor

2014-11-25 11:32:41 632 2

原创 Integer Inquiry(大数相加)

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 explored taking various sums of those numbers.

2014-11-25 11:30:54 465

模仿Windows下画板的程序设计

模仿Windows下画板的程序设计,包含着大量的基本功能,如图形的各种实现以及一些图片变换的功能。。。十分有益于学习

2017-11-02

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除