Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>
#include <numeric>
#include <bitset>
#include <stack>
#include <queue>
@msg555
msg555 / gist:4392298
Created December 27, 2012 21:44
Solution to SPOJ/GF2
#include<stdlib.h>
#include<string.h>
#include<stddef.h>
#include<stdint.h>
#include<stdio.h>
#define ui uint32_t
#define uj uint64_t
#define uk size_t
#define BS 100000000
#define BBS ((uj)BS*BS)
@msg555
msg555 / gam.cpp
Last active December 11, 2015 18:19
Solution to Board Game (gam)
#include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <map>
using namespace std;
int dr[] = {-1, 1, 0, 0};
int dc[] = {0, 0, -1, 1};
@msg555
msg555 / hay.cpp
Last active December 11, 2015 18:58
Solution to Buying Hay (hay)
#include <iostream>
#include <cstring>
using namespace std;
int DP[50010];
int main() {
int N, H;
cin >> N >> H;
@msg555
msg555 / gangnam.py
Created January 27, 2013 21:21
Create plots from discrete set of points. It's set to connect the first and last point together, currently.
#!/usr/bin/python
#
# Example usage
# $ ./gangnam.py | gnuplot
# 9
# 0 0
# 1 1
# 2 2
# 0 2
# 1 1
@msg555
msg555 / B.cpp
Created January 29, 2013 00:28
Balanced Smileys done simply in O(N)
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <queue>
using namespace std;
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <cstdio>
using namespace std;
@msg555
msg555 / C.cpp
Last active December 12, 2015 08:58
Facebook Hacker Cup Round 2
#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <numeric>
@msg555
msg555 / B.cpp
Created February 10, 2013 00:04
Facebook Hacker Cup Round 2
#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <numeric>
@msg555
msg555 / A.cpp
Created February 10, 2013 00:04
Facebook Hacker Cup Round 2
#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <numeric>