목록 ToTal (296)
:: ADVANCE ::
[문자열 검사] 카프-라빈 알고리즘 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899// 해시 값 함수를 이용#include char string[] = "hello my name is ksj";char input[10];int size;int strhash[30];int inputhash; int _strlen(char *str) { int size = 0; while (*(str + size) != '\0') siz..
[문자열 검사] KMP 알고리즘 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071#include char string[] = "naabcdabcdefmeaabcdabcefksj";char input[10] = "abcdabcef";int next[50];int size, stringsize; int _strlen(char *str) { int size = 0; while (*(str + size) != '\0') size++; return size;} void makenext(){ int i; next[0] = 0; ..
가장 긴 증가하는 부분수열 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#include #define N 6 int number[N] = { 10, 20, 10, 30, 40, 50 };int count[N];int index[N]; void init(){ for (int i = 0; i
순열 Permutation 12345678910111213141516171819202122232425262728293031323334353637383940414243#include #define N 4#define R 3 int number[10]; int data[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; void swap(int *first, int *second) { int temp = *first; *first = *second; *second = temp;} void print(int n){ for (int i = n - 1; i >= 0; i--) { printf("%d ", number[i]); } printf("\n");} void permutation(int ..
BAEKJOON ONLINE JUDGE 11378 열혈강호 https://www.acmicpc.net/problem/11378 열혈강호 시리즈 4 네트워크 플로우 이분매칭 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677#include #include #include using namespace std; int n, m, k;vector person[1001];bool visit[1001];int work[1001]; void input(){ int i, cnt, num; scanf("%d %d ..
BAEKJOON ONLINE JUDGE 11377 열혈강호 https://www.acmicpc.net/problem/11377 열혈강호 시리즈 3 네트워크 플로우 이분매칭 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172#include #include #include using namespace std; bool visit[1001];vector person[1001];int work[1001];int n, m, k; void input(){ int i, cnt, num; scanf("%d %d %d", &n, &..
BAEKJOON ONLINE JUDGE 11376 열혈강호 https://www.acmicpc.net/problem/11376 열혈강호 시리즈 2 네트워크 플로우 이분매칭 문제 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667#include #include #include using namespace std; vector work[1001];int n, m;bool visit[1001];int person[1001][2]; void input(){ int i, cnt, num; scanf("%d %d", &n, &m); for (i..
BAEKJOON ONLINE JUDGE 11375 열혈강호 https://www.acmicpc.net/problem/11375 열혈강호 시리즈 1 네트워크 플로우 중 이분 매칭 문제 1. C1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#include int person[1001][1001];int visit[1001];int work[1001]; int bmatch(int p){ int i, w; if (visit[p]) return 0; visit[p] = 1; for (i = 1; i
BAEKJOON ONLINE JUDGE 1085 직사각형에서 탈출 https://www.acmicpc.net/problem/1085 123456789101112131415161718192021222324#include int min(int first, int second){ if (first
BAEKJOON ONLINE JUDGE 1063 킹 https://www.acmicpc.net/problem/1063 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614..