Skip to content

Instantly share code, notes, and snippets.

View morris821028's full-sized avatar
💭
I may be slow to respond.

Morris Yang, Shiang-Yun Yang morris821028

💭
I may be slow to respond.
View GitHub Profile
@morris821028
morris821028 / gist:46069795159847c6b584fb2a0d92a414
Created April 27, 2017 06:40 — forked from ibogun/gist:ec0a4005c25df57a1b9d
Installing gcc 4.9 & g++ 4.9 on Ubuntu 12.04 OR Ubuntu 14.04
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
sudo apt-get install g++-4.9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50
@morris821028
morris821028 / QTREE6.cpp
Last active August 29, 2015 14:27 — forked from anonymous/QTREE6.cpp
QTREE6-lct
#include <cstdio>
const int N = 100009;
int ec,son[N],lnk[N * 2],nxt[N * 2],col[N],fa[N];
struct lct
{
int l[N],r[N],p[N],sz[N],w[N];
void init(int n)
{
++n;
for (int i = 0; i <= n; ++i) l[i] = r[i] = p[i] = sz[i] = 0;