Skip to content

Instantly share code, notes, and snippets.

View boompig's full-sized avatar

Daniel Kats boompig

View GitHub Profile
#include <stdio.h>
int counter = 0;
#define MAX_WORKERS 10
void worker() {
// do stuff;
counter--;
}
"use strict";
// white, black, grey are reserved, and should not be added here
var colours = [
"red",
"green",
"blue"
];
/** The colour to make squares once they're burned */
function doSearch(colourMap, G) {
var open = [[0, 0]];
var pt, x, y, col;
while (open.length > 0) {
do {
if (open.length > 0) {
pt = open.pop();
x = pt[0];
y = pt[1];
#!/bin/bash
# Make sure all of the PHP files in the given directory compile
function verify_php {
for f in "$1"/*
do
item=$(echo "$f" | grep -o "\.php")
st2=$?
if [ -d "$f" ]
<!DOCTYPE>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- mobile support -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<title>Title Here</title>
@boompig
boompig / acm-bankruptcy.cpp
Last active August 29, 2015 14:07
ACM Solution to the 2012 Europe 'kingdom bankruptcy' problem
#include <iostream>
#include <vector>
#include <bitset>
#include <set>
using namespace std;
#define LOG_LEVEL 0
#define DEBUG(s) { \
if (LOG_LEVEL) { std::cerr << s << endl; } \
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
const int MAX_M = 10000;
const int MAX_N = 10000;
#include <iostream>
#include <vector>
#include <utility>
#include <set>
#include <bitset>
using namespace std;
typedef set<pair<int, int> > spi;
const int MAX_N = 200000;
#include <iostream>
#include <set>
#include <bitset>
#include <cstring>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef set<int> si;
#include <iostream>
#include <vector>
using namespace std;
struct region {
int pop, init, delta;
region() {}
region(int N, int I, int D) {
pop = N;
init = I;