Skip to content

Instantly share code, notes, and snippets.

View jiunbae's full-sized avatar

Jiun Bae (June) jiunbae

View GitHub Profile
int MaximumFlow(const graph& g, int s, int t)
{
//maximum flow == return value
int maxflow = 0;
//res is Residual graph
vector<vector<int>> res(g.flow.begin(), g.flow.end());
//parent present where from
vector<int> parent(g.V, -1);
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char * argv[])
{
int test; cin >> test;
while(test--)
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(int argc, char * argv[])
{
ifstream in("self_introduce_number.in");
ofstream out("self_introduce_number.out");
int test; in >> test;
//int test; cin >> test;
//
// convex_hull.h
// DailyCodingTeamNote
//
// Created by MaybeS on 10/3/15.
// Copyright (c) 2015 Maybe. All rights reserved.
//
#pragma warning (disable :4996)
#pragma once
#include <utility>
//
// BIT.h
//
// binary indexed tree
//
// INPUT: tree
//
// OUTPUT: query
//
// Time: O(log(2N))
//
// rREF.h
//
// Reduced row echelon form via Gauss-Jordan elimination
// with partial pivoting.
//
// INPUT: vector<vector<T>> nxm matrix
//
// OUTPUT: rank
//
//
// topologicalSort.h
//
// TopologicalSort
//
// INPUT: vector
//
// OUTPUT: if directed acycilc graph return DAG;
//
// Time: theta(n+m)
//
// trie.h
//
// trie struct for string search
//
// INPUT: vector<string> (keys)
//
// OUTPUT: if string in keys
//
// Time: O(M)
@jiunbae
jiunbae / kruskal
Last active October 31, 2015 16:59
//
// kruskal.h
//
// kruskal algorithm by greedy
//
// INPUT: vector (directed, weighted graph)
//
// OUTPUT: minimum spanning tree
//
// Time: O(ElogV)
//INF Should not interfere Process
#define SEG_INF 0
#include <vector>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;