ens-ulm-1

google hashcode 2014 source for team ens-ulm-1
git clone https://a3nm.net/git/ens-ulm-1/
Log | Files | Refs

commit e55d18c95811cc27d14f880aa67adfcb31c8302c
parent eac36eef984258e0892b35aa8b8a5ebabf5a77a7
Author: Jachiet Louis <louis@jachiet.com>
Date:   Sat,  5 Apr 2014 13:13:53 +0200

Ça compile :)

Diffstat:
contest/louis/louis.cpp | 50++++++++++++++++++++++++--------------------------
1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/contest/louis/louis.cpp b/contest/louis/louis.cpp @@ -3,7 +3,7 @@ #include <future> #include <vector> #include <queue> - +#include "../mc/lecture.cpp" using namespace std; @@ -11,7 +11,6 @@ const int nbVoitures = 8 ; const int nbSommets = 11348 ; const int nbArcs = 17958 ; const int nbSecondes = 54000 ; -const int depart = 4516 ; const int INF = 1000 * 1000 * 100 ; short use[nbSommets][nbSommets] ; int cur_dist[nbSommets] ; @@ -30,29 +29,28 @@ int go_to( int depart, int arrivee) fill(cur_dist,cur_dist+nbSommets,INF); priority_queue<pair<int,int> > todo ; use[depart][depart] = depart ; - todo.push(makepair(0,depart)); - use[depart] - while(!todo.empty()) - { - pair<int,int> t = todo.top(); - todo.pop(); - t.first *= -1 ; - if(t.first == cur_dist[t.second]) - { - for(int v : adj[t.second] ) - { - const int nouv_dist = t.first + longueur[id_arete[make_pair(t.first)]]; - if( nouv_dist != cur_dist[v] ) - { - if(t.first) - use[depart][v] = v ; - else - use[depart][v] = use[depart][t.first] ; + todo.push(make_pair(0,depart)); + while(!todo.empty()) + { + pair<int,int> t = todo.top(); + todo.pop(); + t.first *= -1 ; + if(t.first == cur_dist[t.second]) + { + for(int v : adj[t.second] ) + { + const int nouv_dist = t.first + longueur[id_arete[make_pair(t.first,v)]]; + if( nouv_dist != cur_dist[v] ) + { + if(t.first) + use[depart][v] = v ; + else + use[depart][v] = use[depart][t.first] ; - cur_dist[v] = nouv_dist ; - todo.push(makepair(-nouv_dist,v)); - } - } - } - } + cur_dist[v] = nouv_dist ; + todo.push(make_pair(-nouv_dist,v)); + } + } + } + } }