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 0a32284cab5bee33c70f567b65ad47f16b3db751
parent 720a425c4da26d7dede3163a92e89b04860c5310
Author: Marc Jeanmougin <marc@jeanmougin.fr>
Date:   Sat,  5 Apr 2014 11:45:08 +0200

lecture

Diffstat:
contest/mc/mc.cpp | 47+++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+), 0 deletions(-)

diff --git a/contest/mc/mc.cpp b/contest/mc/mc.cpp @@ -0,0 +1,47 @@ +#include "time.h" +#include <vector> +#include <map> +#include <algorithm> +#include <cstdio> + +using namespace std; + + int n_sommets; + int n_aretes; + int t_autorise; + int n_vehicules; + int depart; + +double longitudes[12000]; +double latitudes[12000]; + +int departs[18000];//depart +int arrivees[18000];//arrivee +bool dbsens[18000];//rue a double sens +int couts[18000];//cout(temps) +int longueurs[18000];//longueur + + + +int main(){ + scanf("%d",&n_sommets); + scanf("%d",&n_aretes); + scanf("%d",&t_autorise); + scanf("%d",&n_vehicules); + scanf("%d",&depart); +for(int i=0;i<n_sommets;i++)scanf("%lf %lf",&longitudes[i],&latitudes[i]); + +vector<vector<int> > adj(12000); + +for(int i=0;i<n_aretes;i++){ + int x; + scanf("%d %d %d %d %d",&departs[i],&arrivees[i],&x,&couts[i],&longueurs[i]); + dbsens[i]=(x==2); + adj[departs[i]].push_back(arrivees[i]); + if(dbsens[i]) adj[arrivees[i]].push_back(departs[i]); +} + +for(int i=0;i<n_sommets;i++)printf("%d %d\n",i,adj[i].size()); + +} +