Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9698    Accepted Submission(s): 3165 Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally…
Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 22390 Accepted Submission(s): 7304 Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Lea…
Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16184    Accepted Submission(s): 5194 Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally…
题意,给出一个N,这是这个三空间的大小,然后给出所有面的状况O为空地,X为墙,再给出起始点的三维坐标和终点的坐标,输出到达的步数 比较坑 z是x,x是y,y是z,Sample InputSTART 1O0 0 00 0 0ENDSTART 3XXXXXXXXXOOOOOOOOOXXXXXXXXX0 0 12 2 1ENDSTART 5OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXOOOOOOO…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2612 Find a way Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifen…
HDU 2612 Find a way(找条路) 00 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)   Problem Description - 题目描述 Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to…
http://acm.hdu.edu.cn/showproblem.php?pid=2612 bfs两次就可将两个人到达所有kfc的时间求出,取两人时间之和最短的即可,这个有点不符合实情,题目应该出两人最大时间最小才对 #include <cstdio> #include <cstring> #include <queue> using namespace std; const int inf=0x3fffffff; char maz[300][301]; int n,…
HDU.2612 Find a way (BFS) 题意分析 圣诞节要到了,坤神和瑞瑞这对基佬想一起去召唤师大峡谷开开车.百度地图一下,发现周围的召唤师大峡谷还不少,这对基佬纠结着,该去哪一个...坤神:我要去左边的这个(因为离自己比较近 哈哈~)..瑞瑞:我要去右边的这个(因为离自己比较近 嘿嘿~) --..这对基佬闹矛盾了,开车有危险了! 为了不让他们去召唤师大峡谷坑人,riot决定让他们去X召唤师大峡谷,保证他俩所走的路程和最短.每走一个点需要花费11分钟,输出他们一共花费多少时间(最短时…
题目传送门 /* BFS:和UVA_11624差不多,本题就是分别求两个点到KFC的最短路,然后相加求最小值 */ /************************************************ Author :Running_Time Created Time :2015-8-4 19:36:36 File Name :HDOJ_2612.cpp ************************************************/ #include <cstd…
题目代号:HDU 2612 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612 Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15919    Accepted Submission(s): 5110 Problem Description Pass a year…
题目链接: http://poj.org/problem?id=1947 题目大意:两人选择图中一个kfc约会.问两人到达时间之和的最小值. 解题思路: 对于一个KFC,两人的BFS目标必须一致. 于是就有以下的SB行为:记录所有KFC,对于每个KFC,对两人BFS.然后你就会看见红红的TLE. 实际上,只需要两次BFS就可以了,用time_k[0][i]记录a同学到达第i个kfc的时间,time_k[1][i]记录b同学到达第i个kfc的时间. 在一次bfs过程中,记录到达所有kfc的时间.…
题目链接:hdu2612 思路:题意是求两个人到某一个KFC花费时间和最小,其实就是求最短距离和,用两个BFS,分别以两个人为起点,分别记录下两人到每个KFC的距离,然后求出最小的和 #include<stdio.h> #include<string.h> #include<queue> #include<algorithm> #define N 205 using namespace std; char map[N][N]; int v[N][N],ans…
多起点 多终点 无向图 结点的个数要自己求 Sample Input6 2 3 //边数 起点数 终点数1 3 5 //u v w1 4 72 8 123 8 44 9 129 10 21 2 //起点8 9 10 //终点 Sample Output9 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <cmath&g…
Key Vertex Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1347    Accepted Submission(s): 305 Problem Description You need walking from vertex S to vertex T in a graph. If you remove one vert…
Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3226    Accepted Submission(s): 1045 Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally.…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1372 Knight Moves Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13384    Accepted Submission(s): 7831 Problem Description A friend of you is doin…
http://acm.hdu.edu.cn/showproblem.php?pid=2066 一个人的旅行 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 36107    Accepted Submission(s): 12313 Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,…
什么时候会产生实例恢复呢?当你数据库服务器异常断电,重启数据库就会发生实例恢复.实例恢复是由数据库自动完成的,无须DBA的干涉.当然这里有个前提条件:数据文件. 在线日志文件.控制文件不得有损坏. 我们用实验来分析一下实例恢复的整个过程吧! 1.在关闭数据库前,我们先看一下几个检查点的SCN --System checkpoint SCN  (存在于控制文件) SQL> select checkpoint_change# from v$database; CHECKPOINT_CHANGE# -…
原文:[百度地图API]让用户选择起点和终点的驾车导航 摘要: 如果用户搜索“从机场到火车站”,使用驾车导航DrivingRoute会默认显示一条结果.但同一个城市可能有多个机场和火车站,那么,如何用可视化的方法让用户自己选择起点和终点呢?答案是,使用数据接口.数据接口,可以让百度地图API的数据,按照自定义的形式展示. 这个功能非常实用,学会这个方法,可以让您的地图更加接近百度地图的功能!! ---------------------------------------------------…
这题最开始给你了N个点,M条边,边是单向边,问不指定起点和终点,最长路是什么??? 脑补一下,不定起点和终点的最短路,用弗洛伊德算法搞一搞,但是...那个垃圾算法的复杂度是N^3的,但是这个算法的M高达5000,直接放弃 仔细想想,可以用剪纸+dijstra做,但是需要改变一下边权,distra求的是最短路,但是我们要的是最长路这个怎么办呢??? 其实可以把边权变成负数,然后把边的权值设置为正的无穷大,那么我们只需要求一个最短路,那么由于权值为负数,这个最短路的值越小,它的相反-----路径之和…
Solution 注意取模!!! Code #include<bits/stdc++.h> #define mod 1000000007 #define LL long long using namespace std; int n, a, b; LL mpow(LL a, LL b) { LL ans = ; , a = a * a % mod) ) ans = ans * a % mod; return ans; } LL fac[], inv[], l[], t[]; void init…
最开始想的暴力DP是把天数作为一个维度所以怎么都没有办法优化,矩阵快速幂也是$O(n^3)$会爆炸. 但是没有想到另一个转移方程:定义$f[i][j]$表示每天都有值的$i$天,共消费出总值$j$的方案数.然后答案就是. 所以每次维护前缀和就可以$O(1)$转移了. 注意前缀和的初值. #include<bits/stdc++.h> #define LL long long #define mod 998244353 using namespace std; int n, m; LL d; L…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612 Problem DescriptionPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifenfei’…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=2612 Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6718    Accepted Submission(s): 2236 Problem Description Pass a year learning in Han…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=2612 题意 有两个人 要去一个城市中的KFC 一个城市中有多个KFC 求两个人到哪一个KFC的总时间最少 求出这个最少的总时间 思路 用BFS打一遍表 求出两个人每人到 每个 KFC 的时间 然后 遍历一下 更新答案 AC代码 #include <cstdio> #include <cstring> #include <ctype.h> #include <cstdl…
分别以两个人的家作为起点,bfs求得到每个KFC最短距离.然后枚举每个KFC,求得时间之和的最小值即可. 此题不符合实际情况之处:  通过了一个KFC再去另一个KFC可以吗? 出题人都没好好想过吗? AC代码 #include<cstdio> #include<cstring> #include<algorithm> #include<queue> using namespace std; const int maxn = 200 + 5; int d[2]…
注意这是一个有向图! 多起点,一终点 反过来,看成一个起点,多个终点,找最短路 因为是有向图 所以u->v 要也要反过来成为v->u Sample Input5 8 5 //结点数 边数 终点1 2 2 //u v w1 5 31 3 42 4 72 5 62 3 53 5 14 5 12 2 3 //起点4 3 41 2 31 3 42 3 211 Sample Output1-1 # include <iostream> # include <cstdio> # i…
题意:小A要乘车到s车站,他有w个起始车站可选,问最短时间. 思路:用Floyd超时,Dijkstra遍历,但是也超时.仔细看看你会发现这道题目好像是多源点单终点问题,终点已经确定,那么我们可以直接转置邻接矩阵,从终点找最小的起点,转换成了单源最短路问题. 代码: #include<cstdio> #include<set> #include<cmath> #include<stack> #include<cstring> #include<…
题目: 链接 思路: 用BFS分别以‘Y’和‘M’的位置为起点进行两次搜索,并把这两次的搜索结果在一个二维数组中保存下来,在对地图遍历遇到‘@’更行最小值. PS: 如果用‘Y’和‘M’点分别去搜每个‘@’,这样妥妥的会超时.当时做这个题脑抽的一批……(烦!!!) 另外如果‘Y’和‘M’到不了‘@’这里的值为0,应该把这种情况排除. 代码: //#include <bits/stdc++.h> #include <queue> #include <cstdio> #in…
Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25379    Accepted Submission(s): 8243 Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally…