commit 10e0bae37f65e07256d0a7f52d8f968fff363f6a
parent b68d84528d850ae5c042410ad4e72ea67ee3aed6
Author: Jachiet Louis <louis@jachiet.com>
Date: Sat, 5 Apr 2014 12:11:24 +0200
lib solution
Diffstat:
3 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/contest/louis/Makefile b/contest/louis/Makefile
@@ -1,3 +1,3 @@
all:
- g++ main.cc -o lpthread -O2
+ g++ main.cc -lpthread -O2
diff --git a/contest/louis/main.cc b/contest/louis/main.cc
@@ -1,8 +1,19 @@
#include <cstdio>
+#include <algorithm>
+#include <future>
+#include <vector>
+using namespace std;
+
+const int nbVoitures = 8 ;
+const int nbSommets = 11348 ;
+const int nbArcs = 17958 ;
+const int nbSecondes = 54000 ;
+const int depart = 4516 ;
int main()
{
+ std::future<bool> fut = async (is_prime,444444443);
return 0;
}
diff --git a/contest/louis/solution.h b/contest/louis/solution.h
@@ -0,0 +1,33 @@
+class solution
+{
+ vector<int> cibles[nbVoitures] ;
+
+ void readFile(const char * s)
+ {
+ FILE * f = fopen(s,"r");
+ for(int v = 0 ; v < nbVoitures ; v++)
+ {
+ int s ;
+ fscanf(f,"%d",&s);
+ while(s--)
+ {
+ fscanf(f,"%d",&s);
+ cibles[v].push_back(s);
+ }
+ }
+ fclose(f);
+ }
+
+ void writeFile(const char * s)
+ {
+ FILE * f = fopen(s,"w");
+ for(int v = 0 ; v < nbVoitures ; v++)
+ {
+ fprintf(f,"%d\n",cibles[v].size());
+ for(int s : cibles[v])
+ fprintf(f,"%d\n",s);
+ }
+ fclose(f);
+ }
+
+};