Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions content/contest/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ set cin ar aw ai is ts=4 sw=4 tm=50 nu noeb bg=dark ru cul sm
syn on | filetype plugin indent on | colo zaibatsu | no ; :
" Select region and then type :Hash to hash your selection.
" Useful for verifying that there aren't mistypes.
ca Hash w !cpp -dD -P -fpreprocessed \| tr -d '[:space:]' \
\| md5sum \| cut -c-6

set makeprg=g++\ -Wall\ -Wconversion\ -Wfatal-errors\ -g\ -std=c++17\ -fsanitize=undefined,address\ %\ -o\ %<
command! Hash w !cpp -dD -P -fpreprocessed \| tr -d '[:space:]' \| md5sum \| cut -c-6
let &makeprg = 'g++ -Wall -Wconversion -Wfatal-errors -g -std=c++17 -fsanitize=undefined,address % -o %<'

map <F5> :w<CR>:make<CR>:!./%< < %<.in<CR>

Expand Down
26 changes: 0 additions & 26 deletions content/data-structures/FenwickRUPQ.cpp

This file was deleted.

5 changes: 2 additions & 3 deletions content/data-structures/chapter.tex
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
\chapter{Data structures}
\kactlimport{SegmentTree.h}
\kactlimport{LazySegmentTree.h}
\kactlimport{MergeSortTree.h}
\kactlimport{FenwickPURQ.cpp}
\kactlimport{FenwickRUPQ.cpp}
\kactlimport{FenwickRURQ.cpp}
\kactlimport{Fenwick2d.h}
\kactlimport{Fenwick2dAdd.h}
\kactlimport{Fenwick2dXor.h}
\kactlimport{OrderStatisticTree.h}
\kactlimport{HashMap.h}
\kactlimport{LazySegmentTree.h}
\kactlimport{DSU.h}
\kactlimport{DSURollback.h}
\kactlimport{SubMatrix.h}
Expand All @@ -17,4 +17,3 @@ \chapter{Data structures}
\kactlimport{Treap.h}
\kactlimport{RMQ.h}
\kactlimport{MoQueries.h}
\kactlimport{MergeSortTree.h}
2 changes: 1 addition & 1 deletion content/kactl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
\kactlchapter{contest}
\kactlchapter{math}
\kactlchapter{data-structures}
% \kactlchapter{numerical}
\kactlchapter{numerical}
\kactlchapter{number-theory}
\kactlchapter{combinatorial}
\kactlchapter{graph}
Expand Down
11 changes: 6 additions & 5 deletions content/strings/Hashing.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const val M = {

val tmp;

val operator+(const val &a, const val &b) {
for (int i = 0; i < H; i++)
tmp[i] = (a[i] + b[i]) % M[i];
return tmp;
}

val operator*(const val &a, const val &b) {
for (int i = 0; i < H; i++)
tmp[i] = a[i] * b[i] % M[i];
Expand All @@ -29,11 +35,6 @@ val operator-(const val &a, const val &b) {
return tmp;
}

val operator+(const val &a, const val &b) {
for (int i = 0; i < H; i++)
tmp[i] = (a[i] + b[i]) % M[i];
return tmp;
}

val getval(int x) {
// make sure x is always positvie if not handle it
Expand Down