Skip to content

Instantly share code, notes, and snippets.

@natsugiri
natsugiri / ModIntTest.java
Created February 18, 2024 07:50
ModIntTest
import java.util.*;
import java.io.*;
public class Main {
static long state;
static long rand() {
state = (state * 123456789 + 765321) % 1000000007;
return state;
}
#include<bitset>
#include<chrono>
#include<cassert>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// VEB
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
struct VEB_BASE {
static const unsigned INVALID = ~0;
unsigned mi, ma;
VEB_BASE() : mi(INVALID), ma(0) { }
@natsugiri
natsugiri / youknow.txt
Last active February 18, 2024 07:50
読んだ
spaghetti source (http://www.prefield.com/algorithm/index.html)
indy256 (https://sites.google.com/site/indy256/)
e-maxx (http://e-maxx.ru/algo/)
@natsugiri
natsugiri / fujishige.cpp
Created July 13, 2015 09:26
Fujishige_Flow
#include<cassert>
#include<queue>
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
@natsugiri
natsugiri / AVLTreeSet.cpp
Last active August 29, 2015 14:15
AVL Tree Set
template<class T> struct AVLTreeSet {
struct Node {
T val;
int s, h;
Node *l, *r;
Node(const T &val=T()): val(val) { s = h = 1; l = r = NULL; }
inline Node*& ch(bool b) { return b? r: l; }
inline void resize() {
s = 1 + size(l) + size(r);
h = 1 + max(height(l), height(r));
@natsugiri
natsugiri / RBSTSet.cpp
Last active August 29, 2015 14:15
RBST Set
template<class T> struct RBSTSet {
struct Node {
T val;
int s;
Node *l, *r;
Node(const T &val=T()): val(val), s(1) { l = r = NULL; }
inline Node*& ch(bool b) { return b? r: l; }
inline void resize() { s = 1 + size(l) + size(r); }
};
Node *root;
@natsugiri
natsugiri / private.xml
Last active August 29, 2015 14:13
$HOME/Library/Application Support/Karabiner/private.xml
<?xml version="1.0"?>
<root>
<item>
<name>dvorak_qwerty</name>
<appendix></appendix>
<appendix>For JIS Mac</appendix>
<appendix>COMMAND_L+KEY_1 to P-DVORAK, COMMAND_L+2 to US-QWERTY</appendix>
<appendix></appendix>
<appendix>## US-QWERTY ##</appendix>
<appendix>1234567890-=\</appendix>
@natsugiri
natsugiri / procon-site
Last active October 21, 2015 04:01
natsugiriが参加すべきプログラミングコンテストサイトまとめ
# natsugiriが参加すべきプロコンサイトまとめ
## Short Term
TopCoder (SRM, TCO)
CodeForces (Codeforces Round, Croc Champ, Surprise Language)
CodeChef (Cook-Off, Lunchtime)
HackerRank (101)
AtCoder (ARC, ABC, JAG)
ACM-ICPC