Skip to content

Instantly share code, notes, and snippets.

View aw31's full-sized avatar

Alexander Wei aw31

View GitHub Profile
@aw31
aw31 / L2.py
Last active June 22, 2016 03:23
Solution for problem L: Luxor Catch-ya! of IPSC 2016. (https://ipsc.ksp.sk/2016/real/problems/l.html)
import numpy
from sklearn import svm
LENGTH = 6
ROWS = 70
COLS = 100
def get_answers(s):
with open(s) as f:
return f.read().split()
@aw31
aw31 / H.cpp
Last active June 19, 2016 01:56
Solution for problem H: Heavy Snowfall of IPSC 2016. (https://ipsc.ksp.sk/2016/real/problems/h.html)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
struct node {
node *p, *c[2];
ll f, w, s, v, t, k, a, b;
node(){}
@aw31
aw31 / Codes for Recursion and Depth-First Search.md
Last active August 29, 2015 14:08
Codes for Recursion and Depth-First Search

Recursion and Depth-First Search

These are the sample codes for each of the problems in the Recursion and Depth-First Search handout. (Available here.)

TODO: Mother's Milk (Java)

@aw31
aw31 / beamer.cpp
Created November 28, 2013 21:56
Beamer presentation generator.
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <vector>
using namespace std;
const string start =
"\\documentclass{beamer}\n"
"\\usetheme{default}\n"
"\\begin{document}\n";