/ https://42jerrykim.github.io/ _index.md
Avatar

42JerryKim

42는 'The Hitchhiker's Guide to the Galaxy'라는 SF 소설에서 삶, 우주, 그리고 모든 것에 대한 궁극적인 질문에 대한 해답이다.

  1. Home
  2. Collections
  3. Search
  4. Categories
  5. Tags
  6. Archives
    1. Dark Mode

Categories

Algorithm (363) Vocabulary (124) PowerShell (123) English (115) ComputerTerms (105) BOJ (92) CMD (87) Design Patterns (54) Git (49) AI (48)

Tags

Best-Practices (1528) Documentation(문서화) (1301) Guide(가이드) (1203) Reference(참고) (1068) Implementation(구현) (1027) Code-Quality(코드품질) (942) Education(교육) (938) Comparison(비교) (934) Testing(테스트) (934) Tutorial(튜토리얼) (881) Performance(성능) (862) Beginner (798) Optimization(최적화) (786) Debugging(디버깅) (754) Deep-Dive (729) How-To (704) Tips (691) Case-Study (671) Advanced (655) C++ (647)

Archives

2026 1161
2025 423
2024 218
2023 24
2022 72
More
Featured image of post [Algorithm] C++ 백준 16745번: What Goes Up Must Come Down
Algorithm BOJ Fenwick Tree

[Algorithm] C++ 백준 16745번: What Goes Up Must Come Down

인접 스왑만으로 수열을 비토닉(비감소 후 비증가) 형태로 재배열할 때 필요한 최소 스왑 수를 구한다. 각 원소를 좌/우 구간에 둘 때의 ‘큰 값과의 역전’ 비용을 Fenwick Tree로 계산해 값별 최적 분할을 합산한다.

12월 19, 2025
4 minute read
Featured image of post [Algorithm] C++ 백준 16895번: 님 게임 3
Algorithm BOJ Game-Theory Bitwise

[Algorithm] C++ 백준 16895번: 님 게임 3

전체 돌더미의 XOR(님합)이 0이면 선공은 필패다. 아니면 어떤 더미 pi를 pi^X로 줄여 님합을 0으로 만드는 모든 첫 수가 승리 수이며, 이를 O(N)으로 센다.

12월 19, 2025
2 minute read
Featured image of post [Algorithm] C++ 백준 17441번: 파리채 만들기
Algorithm BOJ Math Geometry Green's Theorem

[Algorithm] C++ 백준 17441번: 파리채 만들기

단순다각형 내부에서 두 점을 균일·독립으로 뽑을 때 E[|P-Q|^2]를 구한다. 이를 2(E[|P|^2]-|E[P]|^2)로 바꾸고 면적·무게중심·∫x^2,∫y^2를 변 합 공식으로 O(N)에 계산한다.

12월 19, 2025
3 minute read
Featured image of post [Algorithm] C++ 백준 1777번: 순열복원
Algorithm BOJ Data Structure Fenwick Tree Order Statistics

[Algorithm] C++ 백준 1777번: 순열복원

Inversion sequence(각 i 뒤에 나오며 i보다 작은 수의 개수)로부터 Fenwick Tree(BIT)에서 k번째 빈 칸을 찾아 큰 수부터 배치해 순열을 복원한다. O(N log N)으로 N≤100000을 처리한다.

12월 19, 2025
4 minute read
Featured image of post [Algorithm] C++ 백준 17965번: Absolute Game
Algorithm BOJ Game-Theory Greedy

[Algorithm] C++ 백준 17965번: Absolute Game

각자 자신의 배열에서 하나만 남길 때까지 번갈아 삭제한다. 게임 값은 max_x min_y |x-y|로 환원되며, b를 정렬한 뒤 각 a의 최근접 거리 최댓값을 lower_bound로 계산한다.

12월 19, 2025
4 minute read
Featured image of post [Algorithm] C++ 백준 20176번: Needle
Algorithm BOJ Math FFT Convolution Geometry

[Algorithm] C++ 백준 20176번: Needle

세 장벽(위·중·아래) 구멍 3점이 일직선이면 중간 x는 위·아래 x의 평균이다. 위/아래 좌표를 0/1 배열로 만든 뒤 FFT 컨볼루션으로 합=2xm 쌍을 세어 O(R log R)에 통로 개수를 구한다.

12월 19, 2025
3 minute read
Featured image of post [Algorithm] C++ 백준 20506번: Kaisar - 생존
Algorithm BOJ Tree LCA

[Algorithm] C++ 백준 20506번: Kaisar - 생존

트리에서 모든 순서쌍 (x,y)의 LCA를 모아 정렬한 뒤 홀수/짝수 위치 합을 구한다. 각 정점이 LCA가 되는 쌍의 개수를 서브트리 크기 제곱으로 O(N)에 계산한다.

12월 19, 2025
4 minute read
Featured image of post [Algorithm] C++ 백준 22878번: 간단한 문제
Algorithm BOJ Math Sorting

[Algorithm] C++ 백준 22878번: 간단한 문제

점 (p_i,q_i) 쌍에 대해 모든 i,j의 min(|p_i-p_j|,|q_i-q_j|) 합을 구한다. max(|dx|,|dy|)=(|dx+dy|+|dx-dy|)/2를 이용해 p,q,p+q,p-q를 정렬·누적합으로 처리한다.

12월 19, 2025
1 minute read
Featured image of post [Algorithm] C++ 백준 25201번: 보드 뒤집기 게임
Algorithm BOJ Math Implementation

[Algorithm] C++ 백준 25201번: 보드 뒤집기 게임

2×2 블록 뒤집기는 각 행·열에서 색이 바뀌는 칸 수의 홀짝을 보존한다. 현재/목표 빨간 칸의 대칭차를 만들고 행·열별 등장 횟수가 모두 짝수인지 확인하면 O(N+M)으로 YES/NO를 판정한다.

12월 19, 2025
3 minute read
Featured image of post [Algorithm] C++ 백준 2586번: 소방차
Algorithm BOJ DP Greedy Sorting

[Algorithm] C++ 백준 2586번: 소방차

펌프/소방차 좌표를 정렬한 뒤 depth 버킷으로 분해하고, 각 버킷에서 인접 매칭과 1개 제외 DP로 최소 호스 길이 합을 O((P+F) log (P+F))에 계산한다.

12월 19, 2025
4 minute read
1 115 116 117 118 119 120 121 122 123 195
© 2018 - 2026 42JerryKim
Built with Hugo
Theme Stack designed by Jimmy