Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
#define MAXN (1 << 17)
long long tsum[2 * MAXN];
long long tupdate[2 * MAXN];
@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
@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 / 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;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
string S;
for(cin >> S; S != "END"; cin >> S) {
int pos = S.find('+');
#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <set>
#include <map>
using namespace std;
map<string, string> phena, phenb;
#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>
#include <cmath>
using namespace std;
static bool geoerror;
#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) {
@msg555
msg555 / geo.cpp
Last active July 17, 2018 16:11
Mark's geometry routines
#include <algorithm>
#include <vector>
#include <complex>
#include <cmath>
using namespace std;
/* A flag used by some geometry routines to indicate exceptional circumstances.
*/
static bool geoerror;
#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
#include <set>
#include <algorithm>
#include <map>
using namespace std;