본문으로 건너뛰기
김신건의 로그

애니메이션

총 383개 · 10 / 16 페이지 · 217–240

본문 코드 펜스로 삽입: ```anim:<id>

태그로 필터 (697)
Offline Queries, Mo's algorithm reordering 13.0s

쿼리를 블록 단위로 정렬하여 포인터 이동 최소화, O((N+Q)√N)

🔢 알고리즘 offline-queries
22 elements · 5 chapters
#offline #query #mo #sort +2
Palindrome Tree, eertree 14.0s

문자열의 모든 회문 부분문자열을 선형 시간에 관리하는 자료구조, even/odd root 와 suffix link 로 구성.

🔢 알고리즘 palindrome-tree
22 elements · 5 chapters
#algorithm #string #palindrome #eertree
Parity, 이분 그래프 색칠 13.0s

BFS 로 각 정점에 깊이 % 2 색칠. 모순 (같은 색의 인접 정점) 발견 = 홀수 사이클 = 이분 아님.

🔢 알고리즘 parity
18 elements · 5 chapters
#parity #foundation #algorithm
PBS, K 개 쿼리 동시 이분탐색 13.0s

3개 쿼리가 lo/hi 범위를 가지며 4라운드에 걸쳐 동시에 이분탐색, 각자의 k번째 작은 수를 O(log N) 라운드에 찾음.

🔢 알고리즘 pbs
21 elements · 5 chapters
#pbs #parallel-binary-search #query #algorithm
Permutation Tree, 연속 구간 분해 14.0s

순열을 연속 값 구간 단위로 재귀 분해. 각 노드는 increasing, decreasing, prime 타입 중 하나. [3,1,2,5,4] 추적.

🔢 알고리즘 permutation-tree
20 elements · 6 chapters
#algorithm #data-structure #tree #permutation
Persistent Segment Tree (영속 세그먼트 트리) 12.0s

과거 버전 유지, path copying으로 O(log N) 공간/시간 추가

🔢 알고리즘 pst
10 elements · 4 chapters
#data-structure #tree #persistent #pst
Physics Simulation, 낙하 및 반동 12.0s

공이 중력 아래에서 낙하하고, 바닥에 충돌하여 반동. Euler 적분으로 위치와 속도 갱신.

🔢 알고리즘 physics
10 elements · 5 chapters
#physics #math #algorithm
Pick's Theorem, A = I + B/2 - 1 13.0s

격자점 삼각형 (0,0)-(6,0)-(0,8) 의 내부점(I=19)과 경계점(B=12)을 표시하고 A = I + B/2 - 1 = 24 검증.

🔢 알고리즘 pick
14 elements · 5 chapters
#pick #geometry #algorithm
Pigeonhole Principle, N+1 items in N boxes 13.0s

N+1 개 객체를 N 개 상자에 넣으면 한 상자는 두 개 이상 포함

🔢 알고리즘 pigeonhole-principle
16 elements · 4 chapters
#pigeonhole #combinatorics #math #principle
Pollard Rho: ρ 사이클 탐지 14.0s

N=8051 (97*83) 에 대해 Pollard Rho 가 f(x)=x^2+1 로 비자명 약수를 찾는 과정. Floyd 사이클 탐지.

🔢 알고리즘 pollard-rho
16 elements · 5 chapters
#pollard-rho #prime-factorization #number-theory #math
Polygon Area (Shoelace Formula) 13.0s

오각형 (0,0)-(4,0)-(5,2)-(2,5)-(-1,2) 의 넓이를 신발끈 공식 O(N) 으로 계산. sum(x_i y_{i+1}) - sum(y_i x_{i+1}) / 2 = 19.

🔢 알고리즘 polygon-area
17 elements · 5 chapters
#polygon-area #geometry #algorithm
Polynomial Division, Kitamasa의 O(K² log n) 항 계산 12.0s

피보나치 점화식 a_n = a_{n-1} + a_{n-2}의 n번째 항을 O(K² log n)에 계산. 특성다항식 x² - x - 1로 x^n mod f를 이진법 거듭제곱으로 빠르게 구해 선형결합.

🔢 알고리즘 polynomial-division-kitamasa
11 elements · 5 chapters
#algorithm #math #kitamasa #polynomial +1
PriorityQueue, min-heap 의 sift-up / sift-down 14.0s

PriorityQueue 의 백킹 자료구조인 binary heap 에서 offer(추가) 와 poll(최소값 제거) 가 sift up/down 으로 O(log n) 을 유지하는 과정.

🔢 알고리즘 java-priorityqueue-heap
17 elements · 6 chapters
#java #priorityqueue #heap #binary-heap +1
Push-Relabel, 잉여 흐름을 밀어내며 최대 유량 찾기 12.0s

증가 경로 대신 각 정점의 잉여 (excess) 를 국소적으로 밀어내고 (push) 높이를 올려 (relabel) 최대 유량을 O(V² √E) 로 구한다.

🔢 알고리즘 push-relabel
17 elements · 4 chapters
#algorithm #graph #max-flow #push-relabel
Pythagorean Theorem, a^2 + b^2 = c^2 13.0s

직각삼각형 (3,4,5) 의 세 변 위에 정사각형을 그리고 a^2 + b^2 = c^2 관계를 시각화.

🔢 알고리즘 pythagoras
14 elements · 5 chapters
#pythagoras #geometry #algorithm
Quicksort, Lomuto Partition 단계별 12.0s

[4, 2, 7, 1, 5] 의 한 partition 을 명확히 시각화. pivot=마지막, j 가 배열을 스캔하고 i 가 < pivot 인 원소들의 경계를 추적한다. arr[j] < pivot 이면 arr[i] 와 arr[j] 를 swap.

🔢 알고리즘 quicksort
19 elements · 9 chapters
#quicksort #sorting #divide-and-conquer #partition
Recursive Descent Parsing, 표현식 파싱 12.0s

"3 + 5 * (2 - 1)" 를 tokenization 후 recursive descent 로 AST 로 변환, 계산까지.

🔢 알고리즘 parsing
18 elements · 4 chapters
#parsing #recursive-descent #expression #tokenization
Red-Black Tree (레드-블랙 트리) 13.0s

균형 이진 탐색 트리, 삽입/삭제/검색 모두 O(log N) 보장

🔢 알고리즘 rb-tree
9 elements · 5 chapters
#data-structure #tree #balanced #rb-tree
Regions Trick (Mo's Algorithm) 14.0s

비슷한 쿼리들을 영역으로 묶어 캐싱. Mo's 는 쿼리를 (l/√N, r) 로 정렬 후 슬라이딩 윈도로 처리해 amortized O((N+Q)√N).

🔢 알고리즘 regions-trick
26 elements · 4 chapters
#algorithm #query #caching #mo
Rerooting (전체 루트 DP) 13.0s

2번 DFS 로 모든 정점을 루트로 한 DP 값 계산

🔢 알고리즘 rerooting
13 elements · 4 chapters
#tree #dp #rerooting #algorithm
Rope (로프) 11.0s

문자열을 균형 트리로 관리, split/merge로 O(log N) 삽입/삭제

🔢 알고리즘 rope
7 elements · 4 chapters
#data-structure #tree #rope #string
Rotating Calipers: 볼록다각형 최대 거리 14.0s

5개 꼭짓점 볼록다각형에서 회전 캘리퍼스로 가장 먼 두 점 (antipodal) 을 O(N) 에 탐색. 두 평행선 (calipers) 이 회전하며 거리 갱신.

🔢 알고리즘 rotating-calipers
17 elements · 5 chapters
#rotating-calipers #geometry #algorithm
Run Enumerate, ababab 의 Lyndon 분해 + run 발견 13.0s

문자열 ababab 를 Lyndon factorization 한 뒤 각 경계에서 LCP/LCS 확장으로 maximal periodic substring (run) 3개 발견. O(n) 선형 알고리즘.

🔢 알고리즘 run-enumerate
15 elements · 5 chapters
#algorithm #string #run #lyndon +1
Segment Tree 그래프, 구간을 O(log N) 노드로 압축 12.0s

그래프 정점에서 배열 구간으로 가는 간선을 segment tree 내부 노드 O(log N) 개로 압축, 간선 수 절약

🔢 알고리즘 segment-tree-graph
25 elements · 5 chapters
#algorithm #segment-tree #graph-optimization

사이트 검색 / 명령어

검색

스크롤 = 확대/축소 · 드래그 = 이동 · 0 = 원래 크기 · ESC = 닫기