Skip to content

Instantly share code, notes, and snippets.

View mejibyte's full-sized avatar

Andrés Mejía mejibyte

View GitHub Profile
// Andrés Mejía
// Accepted.
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
@mejibyte
mejibyte / gist:2369274
Created April 12, 2012 17:17
.gitconfig
[user]
name = Andrés Mejía
email = andmej@gmail.com
[github]
user = andmej@gmail.com
[color]
ui = auto
[color "branch"]
current = yellow reverse
// Andrés Mejía
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
@mejibyte
mejibyte / trie.cpp
Created March 28, 2012 01:54
Sample implementation of a Trie in C++
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
const int MAXS = 100005; // Max number of states
struct Trie {
int g[MAXS][26];
@mejibyte
mejibyte / gist:2212211
Created March 27, 2012 03:23
Solution to 5792 - Diccionário Portuñol from ICPC Live Archive
// Andrés Mejía
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
@mejibyte
mejibyte / conga.cpp
Created March 26, 2012 18:15
Semillero de programación, marzo 26 2012
#include <iostream>
#include <string>
using namespace std;
int a[1000005];
int main() {
ios::sync_with_stdio(false);
int n;
while (cin >> n) {
@mejibyte
mejibyte / gist:2166667
Created March 23, 2012 04:07
Solution to 5795 - Garden Fence from Live Archive
// Andrés Mejía
// Accepted, 7.772s
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
@mejibyte
mejibyte / gist:2144994
Created March 21, 2012 05:53
Solution to 5791 - Candy's Candy from Live Archive
// Andrés Mejía
// Accepted
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
@mejibyte
mejibyte / rand.in
Created March 15, 2012 19:22
Random tests cases for UVa 820 - Internet Bandwidth
8
4 2 6
5 6 16
5 1 11
4 5 15
6 7 8
1 3 14
6 8 6
11
3 1 4