Skip to content

Instantly share code, notes, and snippets.

View Rogerup's full-sized avatar

Rogerio Penchel Rogerup

View GitHub Profile
#include <bits/stdc++.h> // Compile: g++ -O3 -march=native -fomit-frame-pointer life.cpp -o life.exe
using namespace std;
#define MAX_SIZE (2558 + 2) // 2558 + walls in each edge
#define DSTEP 1024
#define PARENT_SIZE (DSTEP/4 * (ly+2) * (lx+2))
#define parents(step, y, x) parents[(step)*(ly+2)*(lx+2) + (y)*(lx+2) + (x)]
int dchr[4] = { 'D', 'R', 'U', 'L' }; // Down, Right, Up, Left