Skip to content

Instantly share code, notes, and snippets.

@IvanVergiliev
IvanVergiliev / pipe.cc
Last active December 20, 2015 01:19
Custom binary search using std::lower_bound over used-defined iterators.
#include <cstdio>
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;
struct TestCase {
int N;
int K;
@IvanVergiliev
IvanVergiliev / a_star.cc
Created October 23, 2012 00:06
Implementation of A* for the 8-puzzle
#include <cstdio>
#include <map>
#include <set>
#include <vector>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
@IvanVergiliev
IvanVergiliev / typelist.cc
Created August 31, 2012 22:09
Partial implementation of the TypeList functionality from Modern C++ Design
#include <cstdio>
#include <limits>
#include <iostream>
using namespace std;
class NullType {};
template<typename T, typename U>
class TypeList {