- 博客(51)
- 收藏
- 关注
原创 ACdream 1064 完美数
Description 8是中国人很喜欢的一个数字,但是如果有3的存在就变成了38,就不是很好了。。 你能告诉我,在[L, R] 的正整数区间内,要么包含3 要么包含 8 的不同的整数有多少个么? Input 第一行一个整数T (T ≤ 10000),代表数据的组数 对于每组数据给两个整数 L, R (1 ≤ L ≤ R ≤ 1e9)
2015-05-27 21:40:39 439
原创 ACdream 1073 雷霆战机
Description 风风最近迷上了一个打飞机游戏——《雷霆战机》,战机分为白二星、绿三星、蓝四星、紫五星,四种品质。当然,最厉害的是紫色五星的战机啦。 战机分为升级和进阶两种。 升级:提升战机的等级,但战机品质不变。 进阶:可将战机提升一个星级(白二星->绿三星->蓝四星->紫五星)。 为了简化问题,规定战机进阶规则如下: 白色二星: 起始等级Lv1级,满级Lv2
2015-05-27 21:39:54 520
原创 ACdream 1063 平衡树
Description 神奇的cxlove有一颗平衡树,其树之神奇无法用语言来描述 OrzOrz。 这棵树支持3种操作: 1、加入一个数到树中,维护平衡树的合法性; 2、给一个数X,用O(1)的时间求出来树中的数Y使得 Y ^ X 最大(异或操作, Pascal 写作 xor , 0 ^ 0 = 0 , 1 ^ 1 = 0 , 0 ^ 1 = 1 , 1 ^ 0 = 1 , 2 ^ 3 =
2015-05-27 21:39:21 608
原创 ACdream 1061 郭式树
Description 郭橐驼,不知始何名。病偻,隆然伏行,有类橐驼者,故乡人号之驼。驼闻之,曰:“甚善。名我固当。”因舍其名,亦自谓橐驼云。其乡曰丰乐乡,在长安西。驼业种树,凡长安豪富人为观游及卖果者,皆争迎取养。视驼所种树,或移徙,无不活;且硕茂,蚤实以蕃。他植者虽窥伺效慕,莫能如也。 有问之,对曰:“橐驼非能使木寿且孳也,以能顺木之天,以致其性焉尔。凡植木之性,其本欲舒,其培欲
2015-05-27 21:37:22 461
原创 ACdream 1421 TV Show
Description Charlie is going to take part in one famous TV Show. The show is a single player game. Initially the player has 100 dollars. The player is asked n questions, one after another. If
2015-05-22 15:44:25 541
原创 ACdream 1417 Numbers
Description Consider numbers from 1 to n. You have to find the smallest lexicographically number among them which is divisible by k. Input Input file contains seve
2015-05-22 15:42:47 539
原创 ACdream 1427 Nice Sequence
Description Let us consider the sequence a1, a2,..., an of non-negative integer numbers. Denote as ci,j the number of occurrences of the number i among a1,a2,..., aj. We call the sequence
2015-05-22 15:40:20 492
原创 ACdream 1431 Sum vs Product
Description Peter has just learned mathematics. He learned how to add, and how to multiply. The fact that 2 + 2 = 2 × 2 has amazed him greatly. Now he wants find more such examples. Peters
2015-05-22 15:38:46 433
原创 SPOJ 705 New Distinct Substrings
Description Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T Output For each test case output one number saying the number of dist
2015-05-21 11:16:40 497
原创 SPOJ 694 Distinct Substrings
Description Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T Each test case consists of one string, whose length is Output For e
2015-05-21 11:09:01 443
原创 POJ 3261 Milk Patterns
Description Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of milk f
2015-05-21 11:01:59 363
原创 POJ 1743 Musical Theme
Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this
2015-05-21 10:54:34 436
原创 ACdream 1430 SETI
Description Amateur astronomers Tom and Bob try to find radio broadcasts of extraterrestrial civilizations in the air. Recently they received some strange signal and represented it as a wor
2015-05-21 09:20:04 470
原创 ACdream 1429 Rectangular Polygon
Description A rectangular polygon is a polygon whose edges are all parallel to the coordinate axes. The polygon must have a single, non-intersecting boundary. No two adjacent sides must be
2015-05-21 08:43:34 396
原创 HDU 1403 Longest Common Substring
Problem Description Given two strings, you have to tell the length of the Longest Common Substring of them. For example: str1 = banana str2 = cianaic So the Longest Common Substring is "ana
2015-05-20 22:14:37 358
原创 HDU 4658 Integer Partition
Problem Description Given n, k, calculate the number of different (unordered) partitions of n such that no part is repeated k or more times. Input First line, number of test cases,
2015-05-19 21:31:07 452
原创 HDU 4651 Partition
Problem Description How many ways can the numbers 1 to 15 be added together to make 15? The technical term for what you are asking is the "number of partition" which is often called P(n). A partiti
2015-05-19 21:07:07 475
原创 HDU 5229 ZCC loves strings
Problem Description ZCC has got N strings. He is now playing a game with Miss G.. ZCC will pick up two strings among those N strings randomly(A string can't be chosen twice). Each string has the sa
2015-05-16 21:39:25 553
原创 HDU 5228 ZCC loves straight flush
Problem Description After losing all his chips when playing Texas Hold'em with Fsygd on the way to ZJOI2015, ZCC has just learned a black technology. Now ZCC is able to change all cards as he wants
2015-05-16 21:38:54 754
原创 HDU 3240 Counting Binary Trees
Problem Description There are 5 distinct binary trees of 3 nodes: Let T(n) be the number of distinct non-empty binary trees of no more than n nodes, your task is to calculate T(n) mod m. In
2015-05-13 23:48:24 589
原创 HDU 4605 Magic Ball Game
Font Size: ← → Problem Description When the magic ball game turns up, Kimi immediately falls in it. The interesting game is made up of N balls, each with a weight of w[i]. These N balls form a r
2015-05-13 15:17:42 553
原创 HDU 1100 Trees Made to Order
Problem Description We can number binary trees using the following scheme: The empty tree is numbered 0. The single-node tree is numbered 1. All binary trees having m nodes have numbers less th
2015-05-12 20:25:07 1029
原创 HDU 1131 Count the trees
Problem Description Another common social inability is known as ACM (Abnormally Compulsive Meditation). This psychological disorder is somewhat common among programmers. It can be described as the
2015-05-12 17:31:29 470
原创 HDU 5226 Tom and matrix
Problem Description Tom was on the way home from school. He saw a matrix in the sky. He found that if we numbered rows and columns of the matrix from 0, then, ai,j=Cji if i ai,j=0 Tom sudden
2015-05-09 22:25:54 742
原创 HDU 5224 Tom and paper
Problem Description There 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 perimeter of this paper. In
2015-05-09 22:24:46 644
原创 HDU 5225 Tom and permutation
Problem Description Tom has learned how to calculate the number of inversions in a permutation of n distinct objects by coding, his teacher gives him a problem: Give you a permutation of n distinc
2015-05-09 22:24:11 787
原创 HDU 5223 GCD
Problem Description In mathematics, the greatest common divisor (gcd) of two or more integers, when at least one of them is not zero, is the largest positive integer that divides the numbers withou
2015-05-09 22:23:03 871
原创 HDU 5214 Movie
Problem Description Cloud and Miceren like watching movies. Today, they want to choose some wonderful scenes from a movie. A movie has N scenes can be chosen, and each scene is associate with
2015-05-09 22:22:07 362
原创 HDU 1207 汉诺塔II
Problem Description 经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一回只能移动一个圆盘。有预言说,这件事完成时
2015-05-09 22:17:34 932
原创 HDU 2058 The Sum Problem
Problem Description Given a sequence 1,2,3,......N, your job is to calculate all the possible sub-sequences that the sum of the sub-sequence is M. Input Input contains multiple test cases. ea
2015-05-09 22:17:02 392
原创 HDU 2106 decimal system
Problem Description As we know , we always use the decimal system in our common life, even using the computer. If we want to calculate the value that 3 plus 9, we just import 3 and 9.after calculat
2015-05-09 22:16:25 322
原创 HDU 1407 测试你是否和LTC水平一样高
Problem Description 大家提到LTC都佩服的不行,不过,如果竞赛只有这一个题目,我敢保证你和他绝对在一个水平线上! 你的任务是: 计算方程x^2+y^2+z^2= num的一个正整数解。 Input 输入数据包含多个测试实例,每个实例占一行,仅仅包含一个小于等于10000的正整数num。 Output 对于每组测试数据,请按照x,y,z递
2015-05-09 22:13:26 686
原创 HDU 3555 Bomb
Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curr
2015-05-03 21:50:42 386
原创 HDU 3247 Resource Archiver
Problem Description Great! Your new software is almost finished! The only thing left to do is archiving all your n resource files into a big one. Wait a minute… you realized that it isn’t as easy
2015-05-03 10:25:17 491
原创 HDU 3341 Lost's revenge
Problem Description Lost and AekdyCoin are friends. They always play "number game"(A boring game based on number theory) together. We all know that AekdyCoin is the man called "nuclear weapon of FZ
2015-05-03 10:23:21 375
原创 HDU 2825 Wireless Password
Problem Description Liyuan lives in a old apartment. One day, he suddenly found that there was a wireless network in the building. Liyuan did not know the password of the network, but he got some i
2015-05-03 10:22:35 448
原创 HDU 3689 Infinite monkey theorem
Problem Description Could you imaging a monkey writing computer programs? Surely monkeys are smart among animals. But their limited intelligence is no match for our human beings. However, there is
2015-05-03 10:21:17 474
原创 HDU 2604 Queuing
Problem Description Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch
2015-05-03 10:19:43 479
原创 HDU 3407 String-Matching Automata
Problem Description The finite state automaton (FSA) is an important model of behavioral investigations in computer science, linguistics and many other areas. A FSA can be typically modeled as a st
2015-05-03 10:13:49 519
原创 HDU 1385 Minimum Transport Cost
Problem Description These are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is some cargo that should be delivered from one city t
2015-05-03 10:13:00 337
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人