自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ACM!荣耀之路!

【已退役】

  • 博客(49)
  • 资源 (15)
  • 收藏
  • 关注

原创 POJ1833:排列

Description题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。任务描述: 给出某个排列,求出这个排列的下k个排列,如果遇到最后一个排列,则下1排列为第1个排列,即排列1 2 3…n。 比如:n =

2013-11-30 22:10:23 5678 1

原创 POJ2362:Square(DFS)

DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?InputThe first line of input contains N, the number of test cases. Each test case beg

2013-11-30 21:52:41 3623 1

原创 URAL1079:Maximum

http://acm.timus.ru/problem.aspx?space=1&num=1079Consider the sequence of numbers ai,i = 0, 1, 2, …, which satisfies the following requirements:a0 = 0a1 = 1a2i = aia2i+1 = ai + ai+1for every

2013-11-30 21:29:42 1429

原创 POJ1782:Run Length Encoding

DescriptionYour task is to write a program that performs a simple form of run-length encoding, as described by the rules below.Any sequence of between 2 to 9 identical characters is encoded by

2013-11-30 21:25:48 2595

原创 POJ1664:放苹果(DFS)

Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample Output8 其实这道题如果你有这个耐心的话,自

2013-11-30 21:06:16 4017 2

原创 HDU3339:In Action(Dijkstra+01背包)

Problem DescriptionSince 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared across the globe.Nowadays,the crazy boy

2013-11-29 23:56:43 2210

原创 HDU1245:Saving James Bond(Floyd)

Problem DescriptionThis time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of drug dealers. He was sent to a

2013-11-29 23:55:40 2217

原创 HDU1596:find the safest road(Dijkstra)

Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是86

2013-11-27 18:24:27 2082

原创 CF#215DIV2:C. Sereja and Algorithm

Sereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let's represent the input string of the algorithm asq = q1q2...qk. The algo

2013-11-27 01:57:37 2385

原创 CF#215DIV2:B. Sereja and Suffixes

Sereja has an array a, consisting of n integers a1,a2, ..., an. The boy cannot sit and do nothing, he decided to study an array. Sereja took a piece of paper and wrote outm integers l1, l2, ..

2013-11-27 01:54:09 2742

原创 CF#215DIV2:A. Sereja and Coat Rack

Sereja owns a restaurant for n people. The restaurant hall has a coat rack withn hooks. Each restaurant visitor can use a hook to hang his clothes on it. Using thei-th hook costs ai rubles. Only o

2013-11-27 01:51:27 1885

原创 HDU1599:find the mincost route(Floyd)

Problem Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。 Input第一行是

2013-11-26 22:30:56 1654 1

原创 HDU2680:Choose the best route(Dijkstra)

Problem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s

2013-11-26 20:38:43 3128

原创 HDU3833:YY's new problem

Problem DescriptionGiven a permutation P of 1 to N, YY wants to know whether there exists such three elements P[i1], P[i2], P[i3] that P[i1]-P[i2]=P[i2]-P[i3], 1123 InputThe first line is

2013-11-26 20:34:26 2193 1

原创 HDU2807:The Shortest Path(Floyd)

Problem DescriptionThere are N cities in the country. Each city is represent by a matrix size of M*M. If city A, B and C satisfy that A*B = C, we say that there is a road from A to C with distance 1

2013-11-26 16:46:03 1989

原创 HDU1217:Arbitrage(SPFA)

Problem DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US D

2013-11-25 22:35:08 2863

原创 HDU1548:A strange lift(Dijkstra && BFS)

Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When yo

2013-11-25 19:56:57 10064

原创 HDU3790:最短路径问题(Dijkstra)

Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。

2013-11-25 16:12:06 4685

原创 HDU2112:HDU Today(Dijkstra)

Problem Description经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在

2013-11-25 16:09:42 1683

原创 POJ1700:Crossing River

#include #include #include using namespace std;int main(){ int a[1005],i,t,n,sum; scanf("%d",&t); while(t--) { scanf("%d",&n); sum = 0; for(i

2013-11-24 16:00:43 3229

原创 HDU1271:整数对

Problem DescriptionGardon和小希玩了一个游戏,Gardon随便想了一个数A(首位不能为0),把它去掉一个数字以后得到另外一个数B,他把A和B的和N告诉了小希,让小希猜想他原来想的数字。不过为了公平起见,如果小希回答的数虽然不是A,但同样能达到那个条件(去掉其中的一个数字得到B,A和B之和是N),一样算小希胜利。而且小希如果能答出多个符合条件的数字,就可以得到额外的糖果。

2013-11-24 14:48:36 3629

原创 HDU2522:A simple problem

Problem DescriptionZty很痴迷数学问题.。一天,yifenfei出了个数学题想难倒他,让他回答1 / n。但Zty却回答不了^_^. 请大家编程帮助他. Input第一行整数T,表示测试组数。后面T行,每行一个整数 n (1 Output输出1/n. (是循环小数的,只输出第一个循环节). Sample Input4

2013-11-24 14:45:13 2327

原创 HDU2141:Can you find it?(二分)

Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+C

2013-11-24 14:41:35 4192

原创 HDU2199:Can you solve this equation?(二分)

Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky. InputThe first line of the input conta

2013-11-24 14:36:10 3203

原创 HDU2066:一个人的旅行(Dijkstra)

Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时

2013-11-24 14:32:41 14303

原创 HDU2544:最短路(Dijkstra)

Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、M(N输入保证至少存在1条商店到赛场的路线。 O

2013-11-24 14:28:08 1701

原创 HDU1874:畅通工程续(最短路Dijkstra(n^2+nlogn)+Floyd+SPFA(堆栈+队列))

Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input本题目包含多组数据,请处理到文件结束。每组数据第一行包

2013-11-21 23:19:51 4917 2

原创 HDU2871:Memory Control(线段树区间合并)

Problem DescriptionMemory units are numbered from 1 up to N.A sequence of memory units is called a memory block. The memory control system we consider now has four kinds of operations:1.  Rese

2013-11-21 23:13:38 2755

原创 CF#213DIV2:B The Fibonacci Segment

You have array a1, a2, ..., an. Segment[l, r] (1 ≤ l ≤ r ≤ n) is good ifai = ai - 1 + ai - 2, for alli (l + 2 ≤ i ≤ r).Let's define len([l, r]) = r - l + 1,len([l, r]) is the length of the s

2013-11-20 02:30:29 2096

原创 CF#213DIV2:A Good Number

Let's call a number k-good if it contains all digits not exceedingk (0, ..., k). You've got a numberk and an array a containingn numbers. Find out how many k-good numbers are in a (count each

2013-11-20 02:29:00 2631

原创 ZOJ1111:Poker Hands(模拟题)

A poker deck contains 52 cards - each card has a suit which is one of clubs, diamonds, hearts, or spades (denoted C, D, H, S in the input data). Each card also has a value which is one of 2, 3, 4, 5,

2013-11-19 22:03:52 4666

原创 POJ2991:Crane(线段树+几何)

DescriptionACM has bought a new crane (crane -- jeřáb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning of

2013-11-19 18:33:41 4149

原创 HDU2527:Safe Or Unsafe(哈弗曼树)

Problem DescriptionJavac++ 一天在看计算机的书籍的时候,看到了一个有趣的东西!每一串字符都可以被编码成一些数字来储存信息,但是不同的编码方式得到的储存空间是不一样的!并且当储存空间大于一定的值的时候是不安全的!所以Javac++ 就想是否有一种方式是可以得到字符编码最小的空间值!显然这是可以的,因为书上有这一块内容--哈夫曼编码(Huffman Coding);一个字

2013-11-18 21:37:39 3542

原创 ZOJ3622:Magic Number

A positive number y is called magic number if for every positive integer x it satisfies that put y to the right of x, which will form a new integer z, z mod y = 0.InputThe input has multiple cas

2013-11-18 20:18:22 1689

原创 HDU4553:约会安排(线段树区间合并)

Problem Description  寒假来了,又到了小明和女神们约会的季节。  小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会。与此同时,也有很多基友找他开黑,由于数量实在过于巨大,怎么安排时间便成了小明的一大心事。  我们已知小明一共有T的空闲时间,期间会有很多女神或者基友来找小明。  作为一个操作系统曾经

2013-11-14 23:22:30 3081

原创 HDU3397:Sequence operation(线段树区间合并)

Problem Descriptionlxhgww got a sequence contains n characters which are all '0's or '1's.We have five operations here:Change operations:0 a b change all characters into '0's in [a , b]1 a b

2013-11-14 23:15:03 1906 1

原创 POJ3667:Hotel(线段树区间合并)

DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent,

2013-11-14 23:03:40 2836

原创 HDU3308:LCIS(线段树区间合并)

Problem DescriptionGiven n integers.You have two operations:U A B: replace the Ath number by B. (index counting from 0)Q A B: output the length of the longest consecutive increasing subsequenc

2013-11-10 15:48:13 4482 3

原创 HDU4027:Can you answer these queries?(线段树单点更新)

Problem DescriptionA lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be

2013-11-10 15:42:08 3429 1

原创 HDU2368:Alfredo's Pizza Restaurant

Problem DescriptionTraditionally after the Local Contest, judges and contestants go to their favourite restaurant, Alfredos Pizza Restaurant. The contestants are really hungry after trying hard for

2013-11-10 15:28:53 2314

《数值分析》课后答案

《数值分析》课后答案

2015-07-02

离散数学第四版_课后答案

离散数学第四版_课后答案

2015-07-02

JSP毕业设计

完整的毕业设计,代码+文档

2015-06-29

动态规划32讲

动态规划32讲

2013-12-29

最全的C++函数库

C++函数库

2013-12-29

编译原理

编译原理

2013-12-29

《数据结构》课程设计公园导游图

《数据结构》课程设计公园导游图

2013-12-29

代码行统计工具

代码行统计工具

2013-06-08

《数据结构》 严蔚敏的全部代码实现(C语言)

《数据结构》 严蔚敏的全部代码实现

2013-06-08

ACM必做50题

ACM必做50题的解题

2013-06-08

C/C++函数大全

函数大全

2013-06-08

背包九讲(背包)

背包九讲

2013-06-08

叶核亚 java程序设计实用教程 第三版课后答案

Java程序设计实用教程(第3版) (叶核亚) 电子工业出版社 案例及素材

2013-03-09

计算机程序设计艺术

非常有用的专业书籍! 很有用!

2012-10-20

空空如也

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

TA关注的人

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