Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <vector>
using namespace std;
#define MAXN (1ll << 54)
#define MOD 1000000007
#define INF 0x3FFFFFFFFFFFFFFF
inline long long sum_under(long long X) {
#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>
#include <cmath>
using namespace std;
static bool geoerror;
#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <set>
#include <map>
using namespace std;
map<string, string> phena, phenb;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
string S;
for(cin >> S; S != "END"; cin >> S) {
int pos = S.find('+');
@msg555
msg555 / sat.cpp
Created October 18, 2013 15:07
My judge solution to Satisfaction Guaranteed from UChicago's 2013 Invitational Contest.
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef vector<unsigned> bs;
@msg555
msg555 / maps.cpp
Created October 18, 2013 15:05
My judge solution to Overlapping Maps from UChicago's 2013 Invitational Contest.
#include <iostream>
#include <cstdio>
#include <cassert>
#include <cmath>
using namespace std;
/*
X' = ASX + O
(AS-I)X+O = 0
@msg555
msg555 / goat.cpp
Created October 18, 2013 15:00
My judge solution to Goat Ropes from UChicago's 2013 Invitational Contest.
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
#define MAXVAR 50
#define MAXCONSTRAINT 25*49
#define lptype double
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
#define MAXN (1 << 17)
long long tsum[2 * MAXN];
long long tupdate[2 * MAXN];
#include <iostream>
#include <vector>
using namespace std;
string S;
int result;
void solve(int x, int L, int N, int ones) {
if (result > 1) return;
@msg555
msg555 / suffix_linear.cpp
Created September 14, 2013 20:58
Linear time DC3 Suffix Array Construction (And driver program to solve http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2507)
#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;
#define MAXN 1010
int AN;