Skip to content

Instantly share code, notes, and snippets.

int N;
struct Edge { int from, to, residue; };
vector<Edge> edges;
vector<int> graph[N]; // graph[node] = indexes of outgoing edges
void add_edge(int from, int to, int capacity) {
graph[from].push_back(edges.size());
edges.push_back(Edge{from, to, capacity});
graph[to].push_back(edges.size());
@PMitura
PMitura / 0_reuse_code.js
Created February 5, 2016 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#define EPS 1e-6
lat_h = floor(lat);
lat_m = floor(60.0 * (lat - lat_h));
lat_s = 3600.0 * ((lat - lat_h) - (lat_m / 60.0));
if (fabs(lat_s - 60) < EPS) {
lat_s = 0;
lat_m++;
}