• The algorithm for finding detours, as well as determining the detour-critical edges, is important from the viewpoint of network management. Due to a sudden edge failure from some vertex, the message...
• The algorithm for finding detours, as well as determining the detour-critical edges, is important from the viewpoint of network management. Due to a sudden edge failure from some vertex, the ...
• , just some meters away on the same bicycleway the end of the route is completely different and takes a quite large detour. <p>Osmand 2.4.0#17685M <p>48.169724,11.528346,Start correct 48.169983,11....
• 原文地址：http://stackoverflow.com/questions/6905287/how-to-change-the-implementation-detour-of-an-externally-declared-function
原文地址：http://stackoverflow.com/questions/6905287/how-to-change-the-implementation-detour-of-an-externally-declared-function
展开全文
• <div><p>该提问来源于开源项目：urho3d/Urho3D</p></div>
• ## detour 2.1

热门讨论 2010-07-16 17:36:41
Detours Professional 2.1 includes a license for use in production environments and the right to distribute detour functions in products. In addition to support for 32-bit x86 code, Detours ...
• 题目链接：Gym 101666D ...又过了一百年，我终于反应过来：“At no intersection, the bus goes in the direction that is pointed to by the signs.”，意思是不在任何一个交叉口，公交车是按...
题目链接：Gym 101666D

5月8日训练赛的题，专职读题其他啥也不会的本人读了一百遍也没读懂这个题意，挠头。不过这天整体状态都不对，真的“不会读题”了。

又过了一百年，我终于反应过来：“At no intersection, the bus goes in the direction that is pointed to by the signs.”，意思是不在任何一个交叉口，公交车是按标志走的。也就是说，在任何一个交叉口，公交车都不按标志走。

英语学习时间结束。

题意

给你一个图，每个点到点1都存在唯一一条最短路，指向最短路的方向会有一个标志，询问是否能找出一条从0到1的路径，满足在每个点都避开标志的方向。如果能找到，输出步数和路径；否则，输出impossible。

思路

一开始我只能想到从1点到各点用Dijkstra跑一遍最短路，把不能走的路打一个标记，然后再dfs一遍，不走标记过的路，看能否从0到达1。

删边的过程也是按照安学长说的，

			if(dis[i] + d == dis[j]) //边 i -> j 在最短路图中
{
vis1[edge[now]] = 1;
swap(now.first, now.second);
vis1[edge[now]] = 1;
}

这是一开始的写法，错的错的错的。

然后就超时了，额。后来想到安学长说堆优化，就查了一下，发现可以用优先队列优化取最小距离点的过程，就试了一下。最后还是超时，因为我删边的时候直接两层循环1e10，那么我为什么要这么做呢，鬼知道。

第二天接着写，改wa18了，冥思苦想，发现删边的时候不应该删两个方向的边。也就是说，如果从 i 到 j 是最短路的方向，那么从 i 到 j 是不能走的，但是从 j 到 i 是可以走的。

好的继续wa18。此时已经不想再写了。垂死挣扎的时候，终于想明白了，我跑Dijkstra的时候是从1跑的啊，那应该是把 j 到 i 这条边给标记了啊！智商终于上线。

终于到了我最喜欢的贴代码时间：

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<map>
#include<queue>
using namespace std;
typedef long long LL;
typedef pair <LL, int> PLI;

const LL MaxN = 1e5 + 5, MaxM = 1e6 + 5;
LL n, m, all = -1, num = 0;
const LL inf = 1LL << 50;
LL pre[MaxM], other[MaxM], last[MaxN], ans[MaxN], vis[MaxN];
LL dis[MaxN], cost[MaxM];
bool ff = false;
map <PLI, LL> edge; //key为两个顶点，value为边的编号
map <LL, bool> vis1; //根据边的编号记录有没有被删掉

void build(LL x, LL y, LL w)
{
pre[++all] = last[x];
last[x] = all;
other[all] = y;
cost[all] = w;
edge[PLI(x, y)] = all;
vis1[all] = 0;
}

void heap_Dij(LL s)
{
priority_queue <PLI, vector<PLI>, greater<PLI> > que;
for(LL i = 0; i < n; i++) dis[i] = inf;
que.push(PLI(0, s));
dis[s] = 0;
while(!que.empty())
{
PLI p = que.top();
que.pop();
LL node = p.second;
LL ed = last[node];
if(dis[node] < p.first) continue; //这步没太懂什么意思
while(ed != -1)
{
LL dr = other[ed];
if(dis[node] + cost[ed] < dis[dr])
{
dis[dr] = dis[node] + cost[ed];
que.push(PLI(dis[node] + cost[ed], dr));
}
ed = pre[ed];
}
}
}
void dfs(LL x, LL k)
{
vis[x] = 1;
if(x == 1)
{
ans[k] = x;
num = k;
ff = true;
return;
}
if(ff) return;
ans[k] = x;
for(LL ed = last[x]; ed != -1; ed = pre[ed])
{
LL dr = other[ed];
if(vis1[edge[PLI(x, dr)]]) continue;
if(!vis[dr]) dfs(dr, k + 1);
}
}

void deleteEdge(LL s)
{
vis[s] = 1;
queue <LL> q;
q.push(s);
while(!q.empty())
{
LL node = q.front();
q.pop();
LL ed = last[node];
while(ed != -1)
{
LL dr = other[ed];
if(dis[dr] == dis[node] + cost[edge[PLI(node, dr)]])
{
vis1[edge[PLI(dr, node)]] = 1;
}
if(!vis[dr])
{
q.push(dr);
vis[dr] = 1;
}
ed = pre[ed];
}
}
}

int main()
{
all = -1;
memset(last, -1, sizeof(last));
scanf("%I64d %I64d", &n, &m);
for(LL i = 1; i <= m; i++)
{
LL x, y, w;
scanf("%I64d %I64d %I64d", &x, &y, &w);
build(x, y, w);
build(y, x, w);
}
heap_Dij(1);
deleteEdge(1);
memset(vis, 0, sizeof(vis));
vis[0] = 1;
dfs(0, 0);
if(ff)
{
printf("%d ", num + 1);
for(LL i = 0; i <= num; i++)
{
if(i == 0) printf("%I64d", ans[i]);
else printf(" %I64d", ans[i]);
}
printf("\n");
}
else printf("impossible\n");
return 0;
}


展开全文
• <p>Target of the detour; https://github.com/FluffierThanThou/BirdsAndBees/blob/master/Source/Fluffy_BirdsAndBees/Detours/_JobDriver_Lovin.cs</p><p>该提问来源于开源项目：UnlimitedHugs/...
• <p>I am currently porting Detour to the Go language, that I am going to integrate on the server of a multiplayer zombie RPG tower-defense like zombie indie game :stuck_out_tongue_closed_eyes: . ...
• <p>None of this is possible unless I move the detour.crowd package into the game project and write my classes inside the crowd folder or start changing variables, which will be a mess if I update ...
• 阿联酋Impact BBDO的“The Blank Edition”（参加Public Service Advertising单元角逐）和美国FCB New York 的“The Whopper Detour”（参加Product&Service单元角逐）两部作品荣获“Grand Prix of the Year”全场...
韩国 釜山 -- (BUSINESS WIRE) -- (美国商业资讯)--亚洲规模最大的创意节“AD STARS 2019（组委会主席、釜山市长吴巨敦）”吸引了60个国家的2万645部作品参展，其中有545部作品斩获奖项。

阿联酋Impact BBDO的“The Blank Edition”（参加Public Service Advertising单元角逐）和美国FCB New York 的“The Whopper Detour”（参加Product&Service单元角逐）两部作品荣获“Grand Prix of the Year”全场大奖。

“The Blank Edition”是一项利用传统媒体报纸，吸引市民们参与其中，拉动黎巴嫩社会、政治变化，展现充满果敢和勇气的创意的推广活动。

“The Whopper Detour”作为一项推广活动，目的是在竞争对手公司的APP已经在功能和市场份额等方面处于领先的情况下，使汉堡王推出的新APP成功站稳脚跟。推广48小时内，在App Store下载中排名第一。

此次荣膺“Grand Prix of the Year”的两部作品于8月24日在釜山BEXCO举行的颁奖典礼上分别获得了奖杯和1万美元奖金。

此外，获奖名单上还列出了12部大奖作品、60部金奖作品、135部银奖作品和188部铜奖作品。

有人评价道，今年迎来第12届的釜山国际广告节汇聚了全球广告界的相关人士，将广告节的地位提升了一个档次。

2019年度大奖下载:


展开全文
• In this Letter, we propose a simple and effective approach for transforming a conventional Talbot array illuminator (TAI) with multilevel phase steps into a binary-phase TAI (BP-TAI) through detour ...
• <div><p>I noticed a strange detour when using the OsmAnd offline routing. Car routing, fastest route, mostly default settings. OsmAnd version 3.4.8, map data from October 2019. <p>OSM link with the ...
• <div><p>A feature request, or perhaps it already exists: It would be lovely to have the two console apps working in such a manner: <p>./recast -params geometry.obj -o navmesh.nav ./detour -from p0 - ...
• Detour is starting to show up in a lot of places where it hurts us. For example: <h1>307: Can be solved easier with a simple queue <h1>314: Shoehorning data-structures into the existing <code>...
• m investigating the possibility to implement Geisberger <em>et al.</em> [1] proposal for fast detour computation using OSRM. <p>So far I've toy-ed around with the OSRM-as-a-library ...
• After last year’s edition of the BAPC, you are still stuck in Delft. In order to participate again this year, you are going to Amsterdam by bus. During the journey you look out of the window and l...
题意

After last year’s edition of the BAPC, you are still stuck in Delft. In order to participate again this year, you are going to Amsterdam by bus. During the journey you look out of the window and look for traffic signs that point in the direction of Amsterdam. To your surprise, you notice that the bus is never taking the roads that are pointed out by the signs!
You think that the bus company might have chosen a route such that, at no intersection, the bus goes in the direction that is pointed to by the signs. Your friends, however, find this very unbelievable, and don’t think this is possible. Can you figure out whether there exists a bus route that satisfies this requirement? Note that a bus route never visits the same place twice.
A traffic sign pointing in the direction of the shortest route to Amsterdam is placed at every intersection. You may assume that the input graph is both simple and connected, and that there is a unique optimal route to Amsterdam from every intersection.
Input
A single line containing two integers: n (2≤n≤1e5), the number of intersections, and m (1≤m≤1e6), the number of undirected roads that connect the intersections. The intersections are numbered from 0 to n−1
. Delft is denoted by intersection i=0 and Amsterdam is denoted by intersection i=1.m lines that specify the roadsA road is specified by three integers, ai, bi (0≤ai,bi<n and ai≠bi) and di (0≤di≤500000), where ai and bi
are ids of the two intersections that are connected by this road and di is the distance that the bus has to travel to get from ai to bi or vice versa.
Output
As output, give one of the following:
A path from Delft to Amsterdam that satisfies the requirements, in case such a path exists.
A path is specified by a single line containing an integer kk, the length of the path, followed by k integers pi that specify the intersections along the path in the order in which they are crossed, with p0=0 and pk−1=1
The text “impossible”, if such a path does not exist.

题解
堆优化的Dijkstra算法求出以1节点为起点的最短路，然后去除所有在最短路包括的边，对于剩下的边dfs找到一条通路，不能找到则输出impossible
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+7;
typedef long long ll;
const int INF=0x3f3f3f3f;
struct node{
int s,t,c,ne;
} ;
node edge[maxn];
int tot;
int dis[maxn];
bool vis[maxn];
bool f;
int ans[maxn],len=0;
struct nod{
int t,c;
nod(int _t=0,int _c=0):t(_t),c(_c) {}
bool operator <(const nod &r)const
{
return c>r.c;
}
};
{
edge[tot].s=s;
edge[tot].t=t;
edge[tot].c=cost;
}
void Dj(int n,int start){
priority_queue<nod> q;
while(!q.empty()) q.pop();
dis[start]=0;
q.push(nod(start,0));
nod tmp;
while(!q.empty()){
tmp=q.top();
q.pop();
int u=tmp.t;
if(vis[u]) continue;
vis[u]=1;
int v=edge[i].t;
int c=edge[i].c;
if(!vis[v]&&dis[v]>dis[u]+c){
pre[v]=u;
dis[v]=dis[u]+c;
q.push(nod(v,dis[v]));
}
}

}
}
void print_ans(int point)
{
if(point==1)
{
cout<<" "<<0;
return ;
}
print_ans(point-1);
cout<<" "<<ans[point]-1;
}
int n,m;
void dfs(int t,int p){
ans[++len]=t;
vis[t]=1;
if(t==2){
f=1;
cout<<len;
print_ans(len);
cout<<endl;
return ;
}
int v=edge[i].t;
if(pre[t]==v||vis[v]) continue;
dfs(v,t);
if(f) return ;

}
len--;
}
int main(){

memset(pre,-1,sizeof(pre));
memset(vis,0,sizeof(vis));
memset(dis,INF,sizeof(dis));
f=tot=0;
cin>>n>>m;
for(int i=1,s,t,c;i<=m;i++){
cin>>s>>t>>c;
}
Dj(n,2);
memset(vis,0,sizeof(vis));
dfs(1,-1);
if(!f) cout<<"impossible"<<endl;
return 0;

}


展开全文
• Problem D: Detour 9 D Detour After last year’s edition of the BAPC, you are still stuck in Delft. In order to participate again this year, you are going to Amsterdam by bus. During the journey you ...
• <p>in this case, OTP returns a very long detour as the 3rd itnerary when compared to 1st and 2nd. <p>In fact, it's a major back and forth situation... unacceptable for a client. <p>Maybe there is ...
• //Doing this will just call the detour again... right? } else { //do stuff here return whatever; } } </code></pre> <p>I hope what I'm writing makes sense... <p>Cheers, and great library by ...
• While it should stay on the same straight road from A to B (Partijerweg), it takes a very odd detour. That road is perfectly suitable for cycling and not closed or somehow. <p>...
• <p>I believe this is a bug, I cannot get a project using x64detour to build without first including <code><functional></code>. I can confirm the project is setup correctly and is using <code>c&#...
• Your task is to write a program to process a given track and calculate the length of the shortest possible track from the first to the last point of the original track. The shortest possible track ...
• <div><p>Add a guard check against infinite loop occurring in detour, happening when there is a circular reference in m_nodePool, i.e. A -> B -> C -> A. <p>While this might be caused by ...
• t find the right words for the title but the screenshot says it all: <p><img alt="photo_2016-05-20_17-37-10" src=...
• <p>I was trying to unpack some data.win, then the tool says that the game is using YYC and code is embedded into game.exe, and I just ignored it because game code wasn't my matter of interest. I ...
• <p><strong>If you have an issue related to offline maps, tell us the exact name of the map file where the issue occurs, and its edition date.</strong></p> <p>Deutschland Baden-Württemberg 07.09.2019 ...
• <p>You can see on the attached screenshot - recommended route passes through gas station instead on the main street. Location is here: http://osm.org/go/x1u3eA01k--?m= <p>There are turn ...

...