Skip to content

Instantly share code, notes, and snippets.

View TimDumol's full-sized avatar

Tim Joseph Dumol TimDumol

View GitHub Profile
0 1 2540
0 2 4619
0 3 5708
0 4 2903
0 5 1524
0 6 3515
0 7 74
0 8 5489
0 9 4753
0 10 381
@TimDumol
TimDumol / Input
Created May 11, 2011 09:21 — forked from anonymous/gist:966167
MST Sample Input/Output
1 0
3 3
0 1 3
1 2 4
2 0 5
100 4950
0 1 2540
0 2 4619
0 3 5708
0 4 2903
package com.timdumol.algos.numerical;
import java.io.*;
import java.util.*;
import static java.lang.System.*;
public class GaussianElimination {
public static double[] gaussian(double[][] a, double[] b) {
for (int i = 0; i < a.length - 1; ++i) {
{
@TimDumol
TimDumol / B.cxx
Created May 21, 2011 03:40
Google Code Jam 2011 Round 1A: B. The Killer Word
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <list>
@TimDumol
TimDumol / gist:997037
Created May 28, 2011 17:09
Fail Uva 10051
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <stack>
using namespace std;
@TimDumol
TimDumol / gist:997058
Created May 28, 2011 17:37
Uva 10051
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <stack>
using namespace std;
@TimDumol
TimDumol / gist:1002511
Created June 1, 2011 15:17
Gets binary tree from preorder and inorder traversal of nodes.
package com.timdumol.algos.graphs;
/** Computes the hierarchy of a binary tree given its
* in-order and pre-order traversals.
*/
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.lang.System.*;
public class InOrderPreOrder {
call pathogen#runtime_append_all_bundles()
syntax on
colorscheme slate
set background=dark
set ruler " show the line number on the bar
set more " use more prompt
set autoread " watch for file changes
set number " line numbers
set hidden
@TimDumol
TimDumol / gist:1237884
Created September 23, 2011 17:02
Codeforces 88 C: Cycles
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
@TimDumol
TimDumol / gist:1250823
Created September 29, 2011 14:24
Pedometer
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <list>
#include <deque>