Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <cmath>
#define EPS (1e-10)
#define equals(a, b) (fabs(a) - (b)) < EPS)
using namespace std;
class Point {
public:
#include <iostream>
#include <string>
#include <vector>
#include <stack>
using namespace std;
const int max_v = 101;
vector<vector<int> > adj_list;
int d[max_v] = { 0 };
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
const int max_size = 101;
int que[max_size];
int top = 0;
#include <iostream>
using namespace std;
int num_swap = 0;
// Selection sort
void selection_sort(int A[], int n)
{
for (int i = 0; i < n; i++) {
int min = i;
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
// Input
int adj_m[100][100] = { 0 };
int n;
cin >> n;
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
const int s = 251;
int parent(int i) { return i / 2; }
int left(int i) { return 2 * i; }
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
struct node {
int key;
node* left;
node* right;
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
struct node {
int key;
node* left;
node* right;
#include <iostream>
#include <algorithm>
#include <string>
struct {
int parent;
int left;
int right;
} typedef node;
#include <iostream>
#include <algorithm>
#include <string>
struct {
int parent;
int left;
int right;
} typedef node;