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
/** | |
* Signal.hpp | |
* - Simple implementation of the Signal and Slot (Observer pattern) mechanism. | |
* Requires C++11 compatible compiler. | |
* | |
* @author Lee Zhen Yong | |
*/ | |
#pragma once |
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
/****************************************************************************** | |
* Execution: ./DisjointSet < input.txt | |
* Data files: http://algs4.cs.princeton.edu/15uf/tinyUF.txt | |
* http://algs4.cs.princeton.edu/15uf/mediumUF.txt | |
* http://algs4.cs.princeton.edu/15uf/largeUF.txt | |
* | |
* Weighted quick-union by rank with path compression. | |
* | |
* % ./DisjointSet < tinyUF.txt | |
* 4 3 |
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 <iostream> | |
using namespace std; | |
struct Byte { | |
void to4Bits(char c) | |
{ | |
lo = c >> 4; | |
hi = c & 0x0F; | |
} |
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 <iostream> | |
#include <complex> | |
#include <cmath> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
#include <tuple> | |
using namespace std; |
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 <iostream> | |
#include <complex> | |
#include <cmath> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
typedef complex<double> xd; |
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 <iostream> | |
#include <complex> | |
#include <cmath> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
#include <tuple> | |
using namespace std; |
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 <iostream> | |
#include <complex> | |
#include <cmath> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
double PI = acos(0) * 2; |
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 <iostream> | |
#include <vector> | |
using namespace std; | |
typedef vector<int> ivec; | |
ivec polynomialMultiply(const ivec &a, const ivec &b) | |
{ | |
int N = 2 * a.size() - 1; |
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
:: =================== READ ME BEFORE USE!! ============================ | |
:: This build script assumes that cmake, python, TDM-GCC (with OpenMP) | |
:: is in your environment paths. | |
:: | |
:: It also uses Ninja to build Krita (it builds considerably faster!). | |
:: Make sure that ninja executable is in your PATHS also. | |
:: | |
:: Run this script in administrator mode. Make sure you have a stable | |
:: internet connection. | |
:: |
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
% BEGIN -- SETUP DOCUMENT (OVERLEAF) -- | |
\documentclass[a4paper,12pt]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage[british]{babel} | |
\usepackage{csquotes} | |
\usepackage[backend=biber,style=apa]{biblatex} | |
\DeclareLanguageMapping{british}{british-apa} | |
\usepackage[pdftex]{graphicx} | |
\addbibresource{ref.bib} | |
\let\cite\parencite |