Skip to content

Commit

Permalink
change README
Browse files Browse the repository at this point in the history
  • Loading branch information
brpapa committed Oct 10, 2020
1 parent d7ff480 commit f1dc454
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 355 deletions.
360 changes: 13 additions & 347 deletions README.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions notebook/data-structures/sparse-table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Sparse Table
For efficient range queries on a static array A of size N.
Common range queries: min, max
Expand All @@ -13,6 +13,11 @@
f is "overlap friendly" function (or idempotent, f(a,a) = a), if:
f(f(a,b), f(c,d)) = f(a, f(b,c)) for all a,b,c,d
---
https://www.youtube.com/watch?v=uUatD9AudXo&ab_channel=WilliamFiset
https://www.youtube.com/watch?v=inAZoc5K9jo&ab_channel=Programa%C3%A7%C3%A3oCompetitivaUNESP
*/
#include <bits/stdc++.h>
using namespace std;
Expand All @@ -35,7 +40,7 @@ class sparse_table {
table.assign(P+1, vector<ll>(N));

for (int n = 0; n < N; n++) table[0][n] = A[n];

for (int p = 1; p <= P; p++)
for (int n = 0; n+pow2(p) <= N; n++) {
// the answer for a range is the union of the answers for 2 sub-ranges (already computed)
Expand Down
5 changes: 2 additions & 3 deletions scripts/data.py → scripts/index-solutions/data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config = {
'output_path': './README.md',
'output_path': './solutions/README.md',
'emojis': {
'difficulty': {
# 'easy': '🟢',
Expand Down Expand Up @@ -29,8 +29,7 @@
'remote': 'https://github.com/brpapa/competitive-programming/blob/master/solutions'
},
'static_output_lines': [
'Welcome! The `notebook` folder contains general-purpose algorithms, and the `solutions` folder contains the solved problems. Feel free to follow my progress on my main online judge profiles:\n\n'
# 'The book I recommend for studying is \'Competitive Programming 3: The new lower bound of programming contests\' by Steven Halim.\n\n'
'Feel free to follow my progress on my main online judge profiles:\n\n'
],
'main_judges': {
'uva': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def overwrite_file(path):
file.write('</p>\n')

file.write('<br/>\n\n')
file.write('<h1 align="center">Solutions categorized into themes</h1>\n\n')
file.write('<h1 align="center">Solutions index</h1>\n\n')
for u in adj_list[root]:
link = '#' + str(u[1]).replace(' ', '-')
file.write(f'· [{link}]({link}) ')
Expand Down
3 changes: 1 addition & 2 deletions scripts/mark-problem-as-solved.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# usage: ./mark-problem-as-solved.sh JUDGE-FOLDER-PATH PROBLEM-NAME-WITH-EXTENSION

file_md="./scripts/auto-readme-md.py"
file_md="./scripts/index-solutions/runner.py"

git add $1/$2

Expand All @@ -9,7 +9,6 @@ then
g++ -std=gnu++14 ${file_csv} -o ${file_csv%.cpp}
fi

# create README.md
python ${file_md}

git add --update
Loading

0 comments on commit f1dc454

Please sign in to comment.