- 博客(31)
- 收藏
- 关注
原创 完美数列(暴力枚举)
描述给定一个正整数数列,和正整数p,设这个数列中的最大值是M,最小值是m,如果M 现在给定参数p和一些正整数,请你从中选择尽可能多的数构成一个完美数列。输入输入第一行给出两个正整数N和p,其中N(5)是输入的正整数的个数,p(9)是给定的参数。第二行给出N个正整数,每个数不超过109。输出在一行中输出最多可以选择多少个数可
2017-08-29 17:28:06
823
原创 Home Work (贪心法基础)
临近开学了,大家都忙着收拾行李准备返校,但I_Love_C却不为此担心! 因为他的心思全在暑假作业上:目前为止还未开动(-_-!!还以为他有多冷静呢)。暑假作业是很多张试卷,我们这些从试卷里爬出来的人都知道,卷子上的题目有选择题、填空题、简答题、证明题等。 而做选择题的好处就在于工作量很少,但又因为选择题题目都普遍很长。 如果有5张试卷,其中4张是选择题,最后一张是填空题,很明
2017-08-23 18:36:44
1599
原创 GCD & LCM (数学基础)
Given x and y (2 <= x <= 100,000, 2 <= y <= 1,000,000), you are to count the number of p and q such that:1) p and q are positive integers;2) GCD(p, q) = x;3) LCM(p, q) = y.inputThere a
2017-08-22 14:08:57
5774
原创 分糖果系列一(DP+暴力)
描述Oliver分别有币值为1,3,5,7,9,13元的硬币a,b,c,d,e,f枚。一天她去大学生超市买糖吃,糖的价格为g元。问:用Oliver仅有的这6种硬币去恰好购买这g元的糖果,最少需要支付多少个硬币?(当不能支付时输出“impossible”)输入输入数据有多组(当输入连续的7个零时,结束。该组数据不做处理)每组数据依次输入币值为1,3
2017-08-21 09:56:45
949
原创 判断多边形凹凸(计算几何)
描述任意给定一个多边形,判断它是凸还是凹。多边形的顶点以逆时针方向的序列来表示。输入输入包含多组测试数据,每组数据占2行,首先一行是一个整数n,表示多边形顶点的个数,然后一行是2×n个整数,表示逆时针顺序的n个顶点的坐标(xi,yi),n为0的时候结束输入。输出对于每个测试实例,如果地块的形状为凸多边形,请输出“convex”,否则输出”concave”
2017-08-20 12:27:39
4064
原创 Max Sum Plus Plus (DP)
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.G
2017-08-19 11:06:40
347
原创 Area in Triangle (计算几何)
Given a triangle field and a rope of a certain length (Figure-1), you are required to use the rope to enclose a region within the field and make the region as large as possible.inputThe inpu
2017-08-18 16:30:20
470
原创 In-circles Again (计算几何)
In the figure below you can see triangle ABC and its in-circle (Circle that touches all the sides of a triangle internally). The radius of this in circle is r. Three other circles are drawn. Each of
2017-08-18 06:57:06
225
原创 Watashi's BG (深搜)
Watashi is the couch of ZJU-ICPC Team and he is very kind hearted. In ZJU-ICPC summer training camp, students are divided into several groups and each day one of the groups will design some problems
2017-08-17 13:09:53
583
原创 Graph’s Cycle Component(并查集优化)
In graph theory, a cycle graph is an undirected graph that consists of a single cycle, or in other words, some number of vertices connected in a closed chain.Now, you are given a graph where some ve
2017-08-17 12:11:34
641
原创 Risk(最短路径Floyd算法)
Risk is a board game in which several opposing players attempt to conquer the world. The gameboard consists of a world map broken up into hypothetical countries. During a player's turn, armies station
2017-08-16 13:39:20
677
原创 A DP Problem (字符串处理+模拟)
In this problem, you are to solve a very easy linear equation with only one variable x with no parentheses! An example of such equations is like the following:2x - 4 + 5x + 300 = 98xAn expressio
2017-08-16 12:44:32
553
原创 Max Sequence (DP)
Give you N integers a1, a2 ... aN (|ai| <=1000, 1 <= i <= N).You should output S. input The input will consist of several test cases. For each test case, one integer N (2 <= N <= 100
2017-08-16 10:46:40
1125
原创 URL (STL模拟)
WHU ACM Team is working on a brand new web browser named "Whu-Super-Browser". You're in response for a powerful feature: recording the previous addresses. Moreover, when a string is inputted, the brow
2017-08-16 09:36:25
341
原创 Monthly Expense (最大值最小化+二分法)
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi ≤ 10,000) that
2017-08-16 09:30:10
982
原创 Constructing Roads (最小生成树)
There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only if t
2017-08-16 09:15:45
266
原创 迷宫城堡(并查集,强连通分量)
为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N输入输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。 输出对于输入的每组数据,如果任意两个房间都是相互连接的,输出"Yes",否则输出"No"。 样例输入3 31 2
2017-08-15 14:22:35
436
原创 小希的迷宫(并查集)
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的
2017-08-15 13:31:13
292
原创 Friends(并查集)
There are some people traveling together. Some of them are friends. The friend relation is transitive, that is, if A and B are friends, B and C are friends, then A and C will become friends too.
2017-08-15 13:11:12
328
原创 畅通工程(并查集)
描述某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?输入测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路
2017-08-15 13:06:12
196
原创 Oil Deposits (深搜)
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th
2017-08-15 10:23:33
237
原创 Til the Cows Come Home(最短路—Dijkstra算法)
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get b
2017-08-14 14:41:39
5451
1
原创 Minesweeper(深搜)
Minesweeper is a game available with the Windows™ operating system. The object of Minesweeper is to locate all the mines as quickly as possible without uncovering any of them. You can uncover a square
2017-08-14 14:32:46
485
原创 Crashing Robots (复杂模拟)
In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, all warehouses
2017-08-14 08:47:11
848
原创 Bitmap(模拟)
Bitmap is a compression technology for redundant data compression. The ratio of Bitmap Compression is the size of compressed data divides by the size of original data. The following is an example, t
2017-08-13 14:30:20
189
原创 What Day Is It?(模拟)
The calendar now in use evolved from the Romans. Julius Caesar codified a calendar system that came to be known as the Julian calendar. In this system, all months have 31 days, except for April, Jun
2017-08-13 13:50:25
2469
原创 Human Gene Functions (预处理+DP)
It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identif
2017-08-13 13:43:04
735
原创 Meteor Shower(广搜)
Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a
2017-08-13 13:34:17
2979
1
原创 U-Turn (深搜)
Given the map of a town with R x C cells, and each cell is:X: building segment.: a road surfaceEach turn, you can move (up, down, left, or right) from a road surface to the neighboring road su
2017-08-12 15:07:39
323
原创 Page Count (字符串+模拟)
When you execute a word processor'sprint command, you are normally prompted to specify the pages you want printed. You might, for example, enter:10-15,25-28,8-4,13-20,9,8-8 The expression yo
2017-08-12 14:37:01
979
原创 Robberies (01背包问题)
The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrati
2017-08-12 13:07:39
511
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人