Skip to content

Instantly share code, notes, and snippets.

import z3
z3.init("some_path")
def flatten(v, i, j):
formula = 0
for k in range(0, j - i):
formula += pow(10, k) * v[j - k - 1]
return formula
@summerlight
summerlight / rand.cpp
Created October 1, 2013 15:58
random number generation with discrete probability in C++11
#include <random>
#include <map>
#include <iostream>
int main()
{
using namespace std;
mt19937 engine;
discrete_distribution<> dist = {10, 20, 30, 40};