commit db49cba5e5e5ccd333b8d6668ac4752f8bcc8ca9
parent 084ee2c5e93a194b6f8e139eb4b8f03589ccdd25
Author: Jachiet Louis <louis@jachiet.com>
Date: Sat, 5 Apr 2014 13:57:44 +0200
Merge branch 'master' of gitorious.org:ens-ulm-1/ens-ulm-1
Diffstat:
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/contest/mc/mc2.cpp b/contest/mc/mc2.cpp
@@ -24,15 +24,29 @@ srand(time(NULL));
lecture_entree();
printf("%d\n",n_vehicules);
-for(int i=0;i<n_vehicules;i++){
+
+int bsol=0;
+vector<int> best_sol[8];
+
+for(int test=0;test<1000;test++){
+
+
+for(int i=0;i<n_vehicules;i++){
+sortie[i].clear();
int pt=s_depart;
sortie[i].push_back(s_depart);
completion_hasard(0,i);
-
+}
+int aaa=score_solution(sortie);
+if( aaa > bsol){ for(int i=0;i<n_vehicules;i++)best_sol[i]=sortie[i]; bsol=aaa;fprintf(stderr,"%d\n",aaa);}
- printf("%d\n",sortie[i].size());
- for(int j=0;j<sortie[i].size();j++){printf("%d\n",sortie[i][j]);}
}
+
+for(int i=0;i<n_vehicules;i++){
+ printf("%d\n",best_sol[i].size());
+ for(int j=0;j<best_sol[i].size();j++){printf("%d\n",best_sol[i][j]);}
+}
+
}