当前位置: 移动技术网 > IT编程>开发语言>C/C++ > HDU 2586 LCA转RMQ

HDU 2586 LCA转RMQ

2019年01月12日  | 移动技术网IT编程  | 我要评论

对我说谎试试结局,类似hentai8的网站,赵先瑞

题意:就是问两个节点间的距离

思路:又切了一道模版水题,不解释了,看不懂变量含义的可以看我写的这篇,解释的比较详细

#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const int maxn=40010;
struct edge{
    int to,cost;
    edge(int a,int b){to=a;cost=b;}
};
vectorg[maxn];
int dp[maxn*2][20],l[maxn*2],e[maxn*2],dis[maxn],h[maxn];
bool vis[maxn];
int n,k;
void dfs(int t,int deep){
    k++;e[k]=t;l[k]=deep;h[t]=k;
    for(unsigned int i=0;iri) swap(le,ri);
    int kk=0;
    while((1

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网