Skip to content

Instantly share code, notes, and snippets.

View jiunbae's full-sized avatar
🏠
Working from home

Jiun Bae jiunbae

🏠
Working from home
View GitHub Profile
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template <typename type>
struct Comp {
Comp(type val) : _val(val) {}
bool operator() (const pair<type, vector<type>> & vec) const
{
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template<typename type>
class HeapTree {
private:
type max(type a, type b) { return a > b ? a : b; }
type min(type a, type b) { return a > b ? b : a; }
template<typename type>
class HeapTree {
private:
type max(type a, type b) { return a > b ? a : b; }
type min(type a, type b) { return a > b ? b : a; }
vector<type> m_ele, M_ele;
size_t e_size, t_size;
pair<type,type> qquery(size_t node, size_t begin, size_t end, size_t first, size_t second)
{
if (end < first || begin > second)
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
template<typename type>
class IndexTree {
private:
std::vector<type> elements;
import re
test = input()
for i in range(test):
str = raw_input()
result=re.match("[A-F]?A+F+C+$[A-F]?",str)
if(result == None):
print("Good")
else:
print("Infected!")
#include<regex>
#include<iostream>
#include<string>
using namespace std;
int main(int argc, char ** argv)
{
int test; cin >> test;
while (test--)
{
string str; cin >> str;
//INF Should not interfere Process
#define SEG_INF 0
#include <vector>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
@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)
//
// trie.h
//
// trie struct for string search
//
// INPUT: vector<string> (keys)
//
// OUTPUT: if string in keys
//
// Time: O(M)
//
// topologicalSort.h
//
// TopologicalSort
//
// INPUT: vector
//
// OUTPUT: if directed acycilc graph return DAG;
//
// Time: theta(n+m)