- 博客(13)
- 收藏
- 关注
原创 Making the Grade(dp数组)
题目:Making the GradeA straight dirt road connects two fields on FJ’s farm, but it changes elevation more than FJ would like. His cows do not mind climbing up or down a single slope, but they are not fond of an alternating succession of hills and valleys. F
2021-10-03 20:20:48 222
原创 Networking——kruskal模板题
题目:NetworkingYou are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of points. For each possible route between two
2021-08-15 18:03:00 119
原创 Fire Net——(缩点+二分图)
题目:Fire NetSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse is a small castle that has four openings through which to shoot.
2021-08-15 17:29:41 264
原创 I NEED A OFFER!——动态规划
题目:I NEED A OFFER!Speakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校offer的可能性b。不同学校之间是否得到offer不会互相影响。“I NEED A OFFER”,他大叫
2021-08-15 16:51:25 112
原创 欧拉回路——(并查集)
题目:欧拉回路欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 < N < 1000 )和边数M;随后的M行对应M条边,每行给出一对正整数,分别是该条边直接连通的两个节点的编号(节点从1到N编号)。当N为0时输入结束。Output每个测试用例的输出占一行,若欧拉回路存在则输出1,否则输出0。Sample Input3 31
2021-08-15 16:33:32 125
原创 POJ - 2376 Cleaning Shifts——贪心
题目:Cleaning ShiftsFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day into T shifts (1 <= T <= 1,000,0
2021-07-31 11:24:02 99
原创 HDU - 2102 A计划——(搜索+队列)
题目:A计划可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表示,墙用*表示,平地用.表示。骑士们一进入时空传输机就会被转到另一层的相对位置,但如果被转到的位置是墙的话,那骑士
2021-07-31 10:31:59 69
原创 FatMouse and Cheese (记忆化搜索)
题目:FatMouse and CheeseFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid location Fatmouse has hid between 0
2021-05-13 09:11:37 108
原创 记忆化搜索---滑雪
题目:记忆化搜索—滑雪Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个人可以从某个点滑向上下左右相邻四个点之一,当且仅当高度减小。在上面的例子中,一
2021-05-13 08:48:14 68
原创 BFS---倒水问题
题目:BFS—倒水问题You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empty the pot i to the drain;POUR(i,j) pour from pot
2021-05-06 09:35:19 226
原创 并查集---宗教信仰
并查集—宗教信仰题目:There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university believe in.You know that there are n students
2021-04-24 12:38:17 328
原创 Floyd Warshall---Frogger
Floyd Warshall---Frogger题目:Floyd Warshall---Frogger题意:思路:代码:题目:Floyd Warshall—FroggerFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the wat
2021-04-23 21:25:22 136
原创 PTA 第8章结构体与其他结构类型实验
PTA 第8章结构体与其他结构类型实验查找电话号码编写一个程序,输入若干人员的姓名及电话号码(11位),以字符’#’表示结束输入。然后输入姓名,查找该人的电话号码。不允许出现同名。输入样例1:在这里给出一组输入。例如:wanglin 18303721616zhaohaojie 18303721919zhangli 18303721010#zhaohaojie输出样例1:在这里给出相应的输出。例如:number is 18303721919输入样例2:在这里给出一组输入。例
2021-04-20 23:33:52 893
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人