This file contains 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 <algorithm> | |
#include <cassert> | |
#include <climits> | |
#include <iostream> | |
#include <tuple> | |
#include <vector> | |
// m total lines, v + h = m | |
// O(v^2 * h*log(h)) | |
// |
This file contains 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
{-# LANGUAGE DeriveGeneric, GADTs, OverloadedStrings, FlexibleContexts, FlexibleInstances, TypeFamilies, TypeApplications, DeriveAnyClass, StandaloneDeriving, TypeSynonymInstances, MultiParamTypeClasses, ImpredicativeTypes #-} | |
-- following tutorial from https://haskell-beam.github.io/beam/tutorials/tutorial1/ | |
-- minimal example for https://stackoverflow.com/q/69319523/2397327 | |
-- need to have beam-core and beam-sqlite packages installed | |
import Database.Beam.Sqlite | |
import Database.SQLite.Simple | |
-- version 1 |