Skip to content

Instantly share code, notes, and snippets.

#include <tuple>
#include <initializer_list>
#include <math.h>
#include <utility>
using namespace std;
template <typename Tup1, typename Tup2, size_t...s>
double euclidean_distance_impl (Tup1 const &tup1, Tup2 const &tup2, index_sequence<s...>)
#include <tuple>
#include <initializer_list>
#include <math.h>
#include <utility>
using namespace std;
#define USE_RECURSION 1
#if USE_RECURSION
template <int I>
#include <utility>
#include <initializer_list>
#include <stddef.h>
using namespace std;
#define USE_RECURSION 0
#if USE_RECURSION
#include <functional>
#include <typeinfo>
struct C { std::function<void ()> func = [] {}; C () { } };
const type_info &g ();
#include <iostream>
template <int x> struct C {};
template<>
struct C<0> { using type = void; };
struct D : C<1>, C<0> {};
template <typename A = C<0>, typename = typename A::type>
#include <iostream>
template <int x> struct C {};
template<>
struct C<0> { using type = void; };
struct D : C<1>, C<0> {};
template <typename A = C<0>, typename = typename A::type>
#include <vector>
#include <thread>
void do_parallel (size_t n)
{
std::vector<int> a (n), b (n);
double c = clock ();
std::vector<std::thread> threads;
int total_threads = std::thread::hardware_concurrency ();