This file contains hidden or 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> | |
#define let(v, x) __typeof(x) v = (x) | |
#define foreach(i,v) for(let(i, (v).begin());i!=(v).end();++i) | |
using namespace std; | |
template<typename T> struct wrap_itr //{{{ | |
: public iterator<bidirectional_iterator_tag, T>{ | |
typedef wrap_itr<T> It; |
This file contains hidden or 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 <deque> | |
#include <stack> | |
#include <queue> | |
#include <set> | |
#include <map> | |
#include <list> | |
#include <bitset> |
This file contains hidden or 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> | |
using namespace std; | |
#define rep(i, n) for(int i = 0; i < (n); ++i) | |
#define REP(i, b, n) for(int i = (b); i < (n); ++i) | |
#define let(v, x) __typeof(x) v = (x) | |
#define foreach(i,v) for(let(i, (v).begin());i!=(v).end();i++) | |
/** | |
* 割とどうしてくれてもいいけど, 理解 && バグ潰ししてから使うべきです. | |
* |
This file contains hidden or 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> | |
using namespace std; | |
#define rep(i, n) for(int i = 0; i < (n); ++i) | |
#define REP(i, b, n) for(int i = (b); i < (n); ++i) | |
#define let(v, x) __typeof(x) v = (x) | |
#define foreach(i,v) for(let(i, (v).begin());i!=(v).end();i++) | |
/** | |
* 割とどうしてくれてもいいけど, 理解 && バグ潰ししてから使うべきです. | |
* |
This file contains hidden or 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> | |
using namespace std; | |
#define rep(i, n) for(int i = 0; i < (n); ++i) | |
#define REP(i, b, n) for(int i = (b); i < (n); ++i) | |
#define let(v, x) __typeof(x) v = (x) | |
#define foreach(i,v) for(let(i, (v).begin());i!=(v).end();i++) | |
/** | |
* 割とどうしてくれてもいいけど, 理解 && バグ潰ししてから使うべきです. | |
* |
This file contains hidden or 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 rep(i, n) for(int i = 0; i < (n); ++i) | |
#define sz(v) ((int)(v).size()) | |
#define repsz(i, v) rep(i, sz(v)) | |
#define eb emplace_back | |
#define pb push_back | |
#define mt make_tuple | |
#define mp make_pair | |
#define cauto const auto & | |
#define all(v) (v).begin(), (v).end() |
This file contains hidden or 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> | |
using namespace std; | |
template<typename T, size_t n> | |
struct Vec{ | |
typedef vector<typename Vec<T, n-1>::V> V; | |
static V init(const T &x, initializer_list<size_t>::iterator it){ | |
const size_t s = *it; | |
return V(s, Vec<T, n-1>::init(x, ++it)); | |
} |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'pry' | |
require 'pry-nav' | |
require 'simple-random' | |
$bind = false | |
Signal.trap(:SIGUSR1) do | |
$bind = true | |
end | |
def bind! |
This file contains hidden or 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
template<typename T> inline void read(T &x){assert(false);} | |
template<> inline void read<int>(int &x){scanf("%d ",&x);} | |
template<> inline void read<ll>(ll &x){scanf("%lld ",&x);} | |
// template<> inline void read<ll>(ll &x){scanf("%I64d ",&x);} | |
template<typename Arg, typename Arg2, typename ...Args> | |
inline void read(Arg &x, Arg2 &y, Args& ...z){ | |
read<Arg>(x); read<Arg2, Args...>(y, z...); | |
} |
This file contains hidden or 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> | |
using namespace std; | |
int m_a_i_n(int, char **); | |
int main(int argc, char *argv[]){ | |
return m_a_i_n(argc, argv); | |
} | |
#define GET3(_1, _2, _3, NAME, ...) NAME | |
#define main(...) GET3(, ##__VA_ARGS__, m_a_i_n(__VA_ARGS__), m_a_i_n(int _argc, char *_argv[]), m_a_i_n(int _argc, char *_argv[])) |