自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 收藏
  • 关注

原创 Uva 442-Matrix Chain Multiplication (基本栈)

Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is arbitrary. H

2015-12-01 18:17:56 397

原创 Uva514-Rails(基本栈)

There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possible to e

2015-11-30 19:55:17 3471

原创 HDU1032&Uva100 The 3n + 1 problem

Problem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property o

2015-11-22 16:44:03 320

原创 HDU1219-AC Me

Problem DescriptionIgnatius is doing his homework now. The teacher gives him some articles and asks him to tell how many times each letter appears.It's really easy, isn't it? So come on and AC M

2015-11-22 16:41:54 254

原创 HDU1029-Ignatius and the Princess IV

Problem Description"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will be a special integer amo

2015-11-22 16:36:25 340

原创 HDU1877-又一版 A+B

Problem Description输入两个不超过整型定义的非负10进制整数A和B(31-1),输出A+B的m (1 Input输入格式:测试输入包含若干测试用例。每个测试用例占一行,给出m和A,B的值。当m为0时输入结束。 Output输出格式:每个测试用例的输出占一行,输出A+B的m进制数。 Sample Input8 1300 482

2015-11-22 16:33:36 288

原创 HDU 1008-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-11-22 16:31:16 257

原创 Uva11300 - Spreading the Wealth

题目地址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2275题目大意:n个人围成一个圆,每个人有一定的金币数量,然后每个人与左右两边的人交换硬币,这里注意,每个人只能和左右两边的人交换硬币,然后经过一些交换,最终使得每个人的金币数量相同。

2015-11-19 21:36:40 714

原创 Uva11292 The Dragon of Loowater

Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem. The shores of Rellau Creek in central Loowater had always been a prime breeding ground for geese. Due to the

2015-11-18 20:43:59 299

原创 HDU1210 Eddy's 洗牌问题

Problem DescriptionEddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如果他有2N张牌,编号为1,2,3..n,n+1,..2n。这也是最初的牌的顺序。通过一次洗牌可以把牌的序列变为n+1,1,n+2,2,n+3,3,n+4,4..2n,n。那么可以证明,对于任意自然数N,都可以在经过M次洗牌后第一次重新得到初始的顺序。编程对于小于

2015-10-30 21:44:33 552

原创 UVA10815 - Andy's First Dictionary

DescriptionAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinkin

2015-08-02 16:17:18 492

原创 UVA156-Ananagrams

DescriptionMost crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have

2015-08-02 16:02:05 369

原创 UVA101-The Blocks Problem

DescriptionBackground Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robotics (STRIPS)

2015-08-01 21:41:35 301

原创 HDU 2017-字符串统计

Problem Description对于给定的一个字符串,统计其中数字字符出现的次数。 Input输入数据有多行,第一行是一个整数n,表示测试实例的个数,后面跟着n行,每行包括一个由字母和数字组成的字符串。 Output对于每个测试实例,输出该串中数值的个数,每个输出占一行。 Sample Input2asdfasdf123123asdfasdfasdf111

2015-08-01 21:14:46 288

原创 HDU 1412-{A} + {B}

Problem Description给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素. Input每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output针对每组数据输出一行数据,表示合并

2015-08-01 21:07:09 749

原创 HDU 1113-Word Amalgamation

Problem DescriptionIn millions of newspapers across the United States there is a word game called Jumble. The object of this game is to solve a riddle, but in order to find the letters that appear i

2015-08-01 20:57:17 671

原创 UVA1339-Ancient Cipher

DescriptionAncient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in

2015-07-28 23:04:25 330

原创 UVA489-Hangman Judge

DescriptionIn ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the same as

2015-07-28 23:02:17 274

原创 UVA133-The Dole Queue

DescriptionIn a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every day all dole applicants will be p

2015-07-28 22:58:48 187

原创 UVA10340-All in all

DescriptionYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we wil

2015-07-26 13:10:37 248

原创 UVA227-Puzzle

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=163DescriptionA children's puzzle that was popular 30 years ago consisted of a 5x5 frame w

2015-07-26 13:08:25 1854

原创 UVA455 Periodic Strings

DescriptionA character string is said to have period k if it can be formed by concatenating one or more repetitions of another string of lengthk. For example, the string "abcabcabcabc" has perio

2015-07-25 14:00:55 523

原创 UVA1225 Digit Counting

DescriptionTrung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 toN(1 N . After that, he counts the n

2015-07-25 13:05:07 241

原创 UVA1586 Molar mass

DescriptionAn organic compound is any member of a large class of chemical compounds whose molecules contain carbon. Themolar mass of an organic compound is the mass of one mole of the organic

2015-07-25 11:21:59 286

原创 HDU1106 排序

Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 Input输入包含多组测试用例,每组输入数据只有一行数

2015-07-23 15:09:17 428

原创 HDU1005 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). 

2015-07-20 19:05:12 318

原创 HDU1018 Big Number

Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are

2015-07-20 18:42:26 382

原创 HDU 1286 找新朋友

Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。 Input第一行是测试数据的组数CN(Case number,1 

2015-06-08 17:04:30 296

空空如也

空空如也

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

TA关注的人

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