Skip to content

Instantly share code, notes, and snippets.

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
@heno239
heno239 / gist:69e18a4dcfc11678ac8abbec3c37ec2b
Last active October 16, 2020 07:18
Segment_tree_count_number_of_minimum
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
struct online_Z_algorithm {
private:
string s;
vector<int> a;
queue<int> cur;
vector<bool> deleted;
vector<vector<int>> delete_memo;
public:
online_Z_algorithm() { delete_memo.push_back({}); };
@heno239
heno239 / online_Z_algorithm.cpp
Last active July 7, 2020 04:30
online Z algorithm
struct online_Z_algorithm {
private:
string s;
vector<int> a;
set<int> cur;
vector<vector<int>> delete_memo;
public:
online_Z_algorithm() { delete_memo.push_back({}); };
void del(int loc, int len) {
void output_for_gcj(vector<string> &ans) {
int n = ans.size();
rep1(i, n) {
cout << "Case " << i << ": " << ans[i-1] << endl;
}
}
@heno239
heno239 / kyomu.cpp
Created May 14, 2019 15:18
there is kyomu.
//
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
@heno239
heno239 / range_search_tri_tree.txt
Last active December 20, 2018 04:39
second gist
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
//数列aがあったとき、数b,l,rに対して、min{a[i]^b}(l<=i<r)を返すことのできるtri木
//bitの最大数(a[i]<2^30なら30)
const int digits = 30;
struct Node {
const int intmax = 2147483647;
struct SegT {
private:
int n; vector<int> node;
public:
SegT(int sz) {
n = 1;
while (n < sz)n <<= 1;
//nodeの初期化
node.resize(2 * n - 1, intmax);