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
// FILE: main.cc
#include <vector>
#include <string>
#include <algorithm>
#include "utility.h"
using namespace std;
#define VECTOR_SIZE 1000000
#define SWAP_SIZE 100000
#define INF 987654321
#include <stdio.h>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char * argv[])
{
@jiunbae
jiunbae / SW_Maestro
Last active November 29, 2016 11:47
print "\n".join([" ".join([i==j*j and'*'or((not i or not j)and'+'or' ')for j in reversed(range(-25,25))])for i in reversed(range(0,50))])
# coding: utf-8
# # Python으로 웹툰 파싱하기
# ### 필요한 패키지들을 가져옵니다.
# bs4는 BeautifulSoup로 좀 더 간편하게 파싱을 도와줍니다.
# lxml은 beautifulsoup와 같이 사용됩니다.
# In[1]:
# coding: utf-8
# # Python으로 웹페이지 파싱하기
# ### 필요한 패키지들을 가져옵니다.
# bs4는 BeautifulSoup로 좀 더 간편하게 파싱을 도와줍니다.
# lxml은 beautifulsoup와 같이 사용됩니다.
# In[1]:
@jiunbae
jiunbae / random sort
Created May 24, 2016 11:25
Genetic Algorithm - random sort
from random import randrange, uniform, shuffle
from numpy import mean
from functools import reduce
CHILD_SIZE = 100
DNA_SIZE = 16
SORTED = range(DNA_SIZE)
MUTATION_RATE = 0.3
SELECT_BEST_RATE = 0.3
@jiunbae
jiunbae / Red-Black Tree
Last active June 30, 2021 07:27
red black tree implementation in c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(_WIN32) && defined(_MSC_VER)
#pragma warning (disable : 4996)
#endif
enum { RED, BLACK };
/**
segment tree with lazy propagation
init with (vector<T>)
use update to update value with range
query return value of operation defined oper function
*/
#include <iostream>
#include <cmath>
#include <vector>
@jiunbae
jiunbae / go.bat
Last active December 10, 2015 10:34
@echo off
REM ""
REM "2015-12-08 MaybeS"
REM ""
SET version=1.0
SET found=""
SET iKey=%1
SET iPath=""
@jiunbae
jiunbae / CRAZY
Last active December 6, 2015 15:18
#include <fstream>
using namespace std;
int main(int argc, char * argv[])
{
if (argc < 2)
return -1;
string fname(argv[1]);