Skip to content

Instantly share code, notes, and snippets.

View poseidon4o's full-sized avatar

Lyubomir poseidon4o

View GitHub Profile
@poseidon4o
poseidon4o / Snake.cpp
Last active August 29, 2015 14:19
Snake
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
using namespace std;
enum Dir {
Up = 0, Left = 1, Down = 2, Right = 3
};
#include <cstdio>
void f(int x, int y) {
puts("f::f(int, int)");
}
void f(int x) {
puts("f::f(int)");
}
#include <Windows.h>
void main() {
double PCFreq = 0.0;
__int64 CounterStart = 0;
LARGE_INTEGER fr, start, end;
BOOL res = QueryPerformanceFrequency(&fr);
PCFreq = double(fr.QuadPart) / 1000.0;
QueryPerformanceCounter(&start);
#include <cmath>
#include <iostream>
using namespace std;
const double eps = 0.000001;
int signof(double x) {
return x == 0 ? 0 : (x > 0 ? 1 : -1);
}
#include <iostream>
#include <cstdint>
#include <bitset>
using namespace std;
enum FieldColor {
EMPTY = 0,
WHITE = 1,
BLACK = 1 << 1
#include <iostream>
#include <cmath>
using namespace std;
/// group A
int Dist(unsigned A, unsigned B) {
int difference = 0;
for (int c = 0; c < 32; ++c) {
@poseidon4o
poseidon4o / cards.txt
Created March 22, 2016 22:08
Mtg card list
Green Moonmist
Black Accursed Spirit
Green Elder of Laurels
Red Strategy, Schmategy
White Ramosian Captain
Black Ghostly Flame
White Peregrine Griffin
White High Priest of Penance
White Gods Willing
Red Robber Fly
cc
Green Tangle
cc
Green Tangle
report
quit
template <typename T>
struct arr {
struct iterator {
};
iterator begin();
iterator end();
};
#include <array>
#include <bitset>
using namespace std;
const int ALPH_SIZE = 26;
template <typename T, int size>
struct heap_array {
T * m_data;
bitset<size> m_allocated;