Skip to content

Instantly share code, notes, and snippets.

@skalahonza
skalahonza / chocolate.cpp
Last active May 17, 2018 20:13
Try to break chocolate into black and white pieces using minimal ammount of breakings
//TASK: https://cw.felk.cvut.cz/courses/a4b33alg/task.php?task=chocolate
#include <iostream>
#include <vector>
using namespace std;
#ifdef WIN32
int getchar_unlocked() { return getchar(); }
// TASK: https://cw.felk.cvut.cz/courses/a4b33alg/task.php?task=videocard
#include <vector>
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
#if defined(WIN32) && !defined(UNIX)
@skalahonza
skalahonza / KeyNodes.cpp
Last active May 17, 2018 20:15
Find ideal path between improtant noes in cyclic graph https://cw.felk.cvut.cz/courses/a4b33alg/task.php?task=keyservers
//TASK: https://cw.felk.cvut.cz/courses/a4b33alg/task.php?task=keyservers
#include <vector>
#include <cstdio>
#include <stack>
#include <cstdlib>
#ifdef WIN32
int getchar_unlocked() { return getchar(); }
@skalahonza
skalahonza / alg02exam.cpp
Last active May 17, 2018 20:15
Dynamics programing, find ideal route between cinemas to see the most movies https://cw.felk.cvut.cz/courses/a4b33alg/task.php?task=cinemas
//TASK: https://cw.felk.cvut.cz/courses/a4b33alg/task.php?task=cinemas
#include <iostream>
#include <cstdio>
#include <vector>
#define arr std::vector
using namespace std;
#define min(a, b) ((a)<(b)?(a):(b))