- 博客(34)
- 收藏
- 关注
原创 #425
B. Petya and ExamIt’s hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he thinks he lacks time to finish them all, so he asks you to help wit
2017-07-25 17:10:09
429
原创 #424
A. Unimodal Arrayit is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The first block (increasing) and the last block (decreasing) may be abse
2017-07-25 16:49:45
349
原创 HDU-1025
JGShining’s kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines. Half of these cities are rich in resource (we call them rich cities) while the others
2017-07-19 21:03:43
359
原创 POJ 1837
Gigel has a strange “balance” and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm’s length is 15. Some ho
2017-07-19 10:49:25
329
原创 POJ 2392
The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) different types of blocks with which to build the towe
2017-07-19 10:00:11
510
原创 HDU1059 && POJ1014
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same va
2017-07-18 21:58:15
318
原创 HDU 1963 && POJ 2063
John never knew he had a grand-uncle, until he received the notary’s letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only inh
2017-07-18 21:06:01
306
原创 POJ 3211
Dearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him. The clothes are in varieties of colors but each piece of them
2017-07-18 20:45:26
561
原创 POJ 3624
Bessie has gone to the mall’s jewelry store and spies a charm bracelet. Of course, she’d like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each charm i in the s
2017-07-18 20:07:07
516
原创 HDU 4512
吉哥这几天对队形比较感兴趣。 有一天,有n个人按顺序站在他的面前,他们的身高分别是h11, h22 … hnn,吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则称之为完美队形: 1、挑出的人保持他们在原队形的相对顺序不变; 2、左右对称,假设有m个人形成新的队形,则第1个人和第m个人身高相同,第2个人和第m-1个人身高相同,依此类推,当
2017-07-18 20:01:43
352
原创 HDU 2844&& POJ 1742
Whuacmers use coins.They have coins of value A1,A2,A3…An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted t
2017-07-16 20:49:31
368
原创 HDU 2191
急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记: 人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。 月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知
2017-07-16 20:15:07
242
原创 DP
动态规划 ①符合无后效性:不管之前的这个状态是如何的到的(之前计算的最优不会因为后面的数据而没用) ②最优子结构:每个阶段的最优状态可以从之前的某个阶段的某个或某些状态直接得到 设计步骤: 一、分析子问题 二、做表 自己总结的,不供参考 类型: 数塔 http://acm.hdu.edu.cn/showproblem.php?pid=2084#include#inclu
2017-07-16 19:51:37
326
原创 HDU 1203
Speakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校offer的可能性b。不同学校之间
2017-07-16 17:53:43
292
原创 HDU 1421
搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比(这里补充一
2017-07-16 17:43:39
292
原创 HDU 1160
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence
2017-07-16 16:44:11
334
原创 HDU1024
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. Given a
2017-07-15 17:01:21
390
原创 HDU1087
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The
2017-07-15 14:52:42
403
原创 #423
第一次参加CF比赛T^T真是惊险刺激啊!大佬太多了!!!膜拜大佬!A. Restaurant Tablestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outp
2017-07-12 16:07:54
341
原创 HDU 1176动态规划
都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝
2017-07-07 22:35:28
309
转载 UVA - 12657
#include#includeusing namespace std;int left[100005], right[100005]; void link(int l, int r) { left[r] = l; right[l] = r;} int main(){ int test = 0, op, x, y, temp, n, m
2017-06-07 15:43:43
221
转载 UVA - 11988
You’re typing a long text with a broken keyboard. Well it’s not so badly broken. The only problemwith the keyboard is that sometimes the “home” key or the “end” key gets automatically pressed(internal
2017-06-07 15:40:22
255
原创 UVA - 673
You are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a) if it is the empty string(b) if A and B are correct, AB is correct,(c) if A is correct, (A)
2017-06-07 15:38:28
299
原创 UVA - 133
In a serious attempt to downsize (reduce) the dole queue, The New National Green Labour RhinocerosParty has decided on the following strategy. Every day all dole applicants will be placed in a largeci
2017-06-07 15:33:35
277
原创 UVA - 101
题解:#include#include#include#includeusing namespace std;void initi(int place[], int blocks[][30], int top[], int x){ while(blocks[place[x]][top[place[x]]] != x) { int now = blocks[place[x]][
2017-06-07 15:31:34
397
原创 POJ - 3750
有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个出列,如此重复下去,直到所有的小孩都出列(总人数不足S个时将循环报数),求小孩出列的顺序。Input第一行输入小孩的人数N(N接下来每行输入一个小孩的名字(人名不超过15个字符) 最后一行输入W,S (W Output按人名输出小孩按顺
2017-06-07 15:24:39
432
原创 HDU - 1443
The Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., n, standing in circle every mth is going to be executed
2017-06-07 15:21:33
292
原创 HDU - 1870
四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。 用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。 Input本题目包含多组测试,请处理到文件结束
2017-05-30 17:42:27
278
转载 HDU - 1237
读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。 Output对每个测试用例输出1行,即该表达式的值,精确到小数点后2位。 Sample Input1 + 24
2017-05-30 17:38:35
381
原创 HDU - 1022
As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over t
2017-05-30 17:37:25
276
原创 HDU - 1702
ACboy was kidnapped!! he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(. As a smart ACMer, you want to get ACboy out of the monst
2017-05-30 17:35:10
310
原创 HDU - 1020
Given 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" is the only character i
2017-05-30 17:29:05
433
原创 POJ - 1363
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
2017-05-30 17:01:48
320
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人