This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct WaveletTree{ | |
int lo, hi; | |
WaveletTree *l, *r; | |
vector<int> b; | |
//from and to are array pointers | |
//Build Wavelet Tree on A[from...to]; | |
//x <= A[j] <= y, for each from <= j <= to | |
//Warning : Changes the original array A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SegmentTree { | |
vector<ll> t; | |
int n; | |
inline ll ops(ll a, ll b) {return max(a,b);} | |
SegmentTree(vector<ll> &a) { | |
n = a.size(); | |
t.resize(2*n); | |
for (int i = 0; i < n; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define pb push_back | |
#define fill(x, y) memset(x, y, sizeof(x)) | |
#define all(x) (x).begin(), (x).end() | |
#define debug(x) { cerr << #x << " = " << x << endl; } | |
#define IO { ios_base::sync_with_stdio(false); cin.tie(0); } | |
#define read(x) freopen(x, "r", stdin) | |
#define write(x) freopen(x, "w", stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SuffixArray | |
{ | |
vector<int> arr, lcp; | |
SuffixArray(string s) { | |
arr = suffix_array_construction(s); | |
s.pop_back(); | |
lcp = lcp_construction(s, arr); | |
} | |
int size() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define pb push_back | |
#define fill(x, y) memset(x, y, sizeof(y)) | |
#define all(x) (x).begin(), (x).end() | |
#define debug(x) { cerr << #x << " = " << x << endl; } | |
#define IO { ios_base::sync_with_stdio(false); cin.tie(0); } | |
#define read(x) freopen(x, "r", stdin) | |
#define write(x) freopen(x, "w", stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"keys": ["alt+`"], "command": "toggle_terminus_panel" | |
}, | |
{ | |
"keys": ["f6"], "command": "terminus_open", "args": { | |
"cmd": ["python", "$file"], | |
"cwd": "${file_path:${file}}", | |
"post_window_hooks": [ | |
["carry_file_to_pane", {"direction": "right"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"keys": ["alt+`"], "command": "toggle_terminus_panel" | |
}, | |
{ | |
"keys": ["f6"], "command": "terminus_open", "args": { | |
"cmd": ["python3", "$file"], | |
"cwd": "${file_path:${file}}", | |
"post_window_hooks": [ | |
["carry_file_to_pane", {"direction": "right"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
template<typename T> | |
void debug(T args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import math | |
# Deliver more amadeusium to hq (left side of the map) than your opponent. Use radars to find amadeusium but beware of traps! | |
# height: size of the map | |
def debug(*args): | |
for i in args: | |
print(i, file = 'sys.stderr') | |