题意::从起点到终点的所有的最短路中,找出离终点有X个路口的城市一共有几个 开始我用最短路+DFS从起点开始搜,超时了 换了一种方法,从终点开始搜,AC #include<stdio.h> int N; const int MAX=1e9; ]; ]; ][]; ]; ]; int maxDis; int allPoint; int start,end,shortNum; void dijk() { int i,j,min,rj,from; dis[start]=; ;i<=N;i++)…
A Walk Through the Forest Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8850 Accepted Submission(s): 3267 Problem Description Jimmy experiences a lot of stress at work these days, especiall…
One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a relation is defined to be the total time length of all the phone calls made b…
Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to walk home. To make things even nicer, his office is on one side of a forest, and his house is on the ot…
Let's play computer game Description xxxxxxxxx在疫情期间迷上了一款游戏,这个游戏一共有nnn个地点(编号为1--n1--n1--n),他每次从一个地点移动到另外一个地点需要消耗 一定的能量,每一个地点都有一些珠宝,输入中会把每一个地方的珠宝价值估算成一个值. xxxxxxxxx想请聪明的你帮他找出来从编号为sss的地点,到编号为ddd的地点最小要消耗多少能量,消耗这些能量最多获得多少价值的珠宝 Input 第一行输入n,s,dn,s,dn,s,d.其…
旅行 Time Limit: 1000 MS Memory Limit: 32768 K Total Submit: 18(6 users) Total Accepted: 3(3 users) Rating: Special Judge: No Description "04.24,和Sakura去东京天空树,世界上最暖和的地方天空树的顶上. " "04.26.和Sakura去明治神宫.有人在那里举办婚礼." "04.25.和Sakura去迪士尼.鬼屋非…
You are given a weighed undirected connected graph, consisting of nn vertices and mm edges. You should answer qq queries, the ii-th query is to find the shortest distance between vertices uiui and vivi. Input The first line contains two integers n an…
http://poj.org/problem?id=3009 Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a square mesh is marked. The…
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7337 Accepted Submission(s): 4591 Problem Description There is a rectangular room, covered with square tiles. Each tile is color…
这是第一次全部做出来的依次练习了,有一些都是做过两遍了的,但是还是错了几回,更多时候我还是应该多注意下细节,就好像章爷笑我 的一样,像什么vis[]标记没清0,什么格式错误,还有什么题目没看清,还是的注意一下了. 地址:8.1搜索练习 Problem A POJ 2488 A Knight's Journey 题目大意就是说帮你给你个P*Q的棋盘,让马一次全部走完,每个点只能走一次,而且要按照字典序输出(这句话最坑!!!). 这道题做过了两三次了,却老是被那句“字典序输出”给坑死.第一次看到这道…
Oil Deposits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15533 Accepted Submission(s): 8911 Problem Description The GeoSurvComp geologic survey company is responsible for detecting underg…
Counting Sheep Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 14 Accepted Submission(s) : 12 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description A while ago I had trou…
Problem Description 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 the land into numerous square pl…
Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison. Angel's friends want to save Angel. Their task is: approa…
Problem Description 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 the land into numerous square pl…
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8795 Accepted: 3692 Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an…
题目描述 There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can move only on blac…