Skip to content

Instantly share code, notes, and snippets.

View dev-yong's full-sized avatar
🤔
Let's think more

LeeGwangYong dev-yong

🤔
Let's think more
  • Viva Republica (TOSS)
  • Korea, Republic of
View GitHub Profile
@dev-yong
dev-yong / KMP(교육용).cpp
Created February 15, 2017 14:25
kmp(교육용)
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
#define MAX_N 1000001
char t[MAX_N], p[MAX_N];
int n, m;
vector<int> res;
int fail[MAX_N];
@dev-yong
dev-yong / string.cpp
Created February 15, 2017 14:24
문자열(교육용)
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
/*
char char_arr[5] = { 'A','P','P','L','E' };
char char_arr[5]="APPLE";
어째서 에러가 날까?
@dev-yong
dev-yong / BOJ)1764.cpp
Created February 8, 2017 15:30
문자열 + 이진탐색
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
#define MAX_N 500001
char hear[MAX_N][21];
char see[21];
char hearsee[MAX_N][21];
@dev-yong
dev-yong / KMP.cpp
Last active February 5, 2017 10:26
kmp(기초)
//failfunction의 값들을 알고 있는 경우
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
const int MAX = 1000000;
int main(){
char W[MAX+1], S[MAX+1];
int M, N;
@dev-yong
dev-yong / segment_tree_basic.cpp
Last active February 4, 2017 09:25
세그먼트 트리(기초)
//2042-구간합구하기
#include <iostream>
#include <algorithm>
using namespace std;
int n, m, k;
long long seg[5000000];
long long update(int pos, int val, int node, int x, int y) {
/*재귀함수의 기저조건*/