Skip to content

Commit d02f9ec

Browse files
authored
Merge pull request #38 from chermehdi/doc/update
Update docs.
2 parents 785fcff + 29d8a4d commit d02f9ec

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,43 @@ and help execute tests locally via their favorite programming language.
3131
- `egor batch (in developement)`: Tests the main solution for this task against another solution (probably written in another language than the main one)
3232
by running both of them and feeding them the tests for this task, this is useful if you have a brute force solution and an efficient solution
3333
and you want to validate the optimal solution against the one you are sure that is working.
34+
35+
## C++ Library code
36+
- If you are using C++ to do competitive programming, and you have your own library that you use,
37+
you can just tell egor the location of your library, and it will use it when finding tasks that rely on it.
3438

39+
### Steps to make it work
40+
1- run `egor config set cpp.lib.location /path/to/root/of/library` to tell egor the path to use to resolve your includes.
41+
42+
2- Create your tasks normally and use your library:
43+
44+
```cpp
45+
#include <iostream>
46+
#include <vector>
47+
// notice the include is using " and not <
48+
#include "kratos/graphs/tree.h"
49+
50+
using namespace std;
51+
52+
int main() {
53+
int n; cin >> n;
54+
kratos::Tree tree;
55+
for(int i = 0; i < n - 1; ++i) {
56+
int u, v; cin >> u >> v;
57+
tree.add_edge(u, v):
58+
}
59+
cerr << tree.debug() << endl;
60+
}
61+
```
62+
63+
3- In this example, the configuration i have is:
64+
```
65+
$ egor config set cpp.lib.location
66+
/home/directory/include
67+
68+
$ ls /home/directory/include
69+
kratos
70+
```
3571
## Contribution
3672

3773
- Contribution to the project can be done in multiple ways, you can report bugs and issues or you can discuss new features that you like being added in future versions by creating a new issue

0 commit comments

Comments
 (0)