haechandev

Notes from
the work.

I write about what I learn while building, how I work with AI, and how I make sense of systems.

Algorithms · August 19, 2026

What I used to calculate before writing code

Revisiting old C-style Baekjoon solutions to find habits around input size, memory, iteration counts, and state lifetime.

CAlgorithmsMemoryTime complexityBaekjoonProblem solving

Algorithms · October 6, 2023

[Baekjoon 2156] Wine Tasting with DP

A dynamic programming solution with states for the number of consecutive glasses consumed.

BaekjoonAlgorithmsDPDynamic programming

Algorithms · January 15, 2023

[Baekjoon 2169] Robot Control

Scan each row in both directions and combine the best values from the preceding row.

BaekjoonDPGrid DP

Algorithms · January 14, 2023

[Baekjoon 1516] Game Development

A dependency DP that memoizes the latest completion time among prerequisite buildings.

BaekjoonDPGraphsTopological sorting

Algorithms · January 12, 2023

[Baekjoon 1520] Downhill

A memoized DFS that counts paths by walking backward from the destination to higher neighbors.

BaekjoonDFSDPMemoization

Algorithms · September 2, 2022

[Baekjoon 2225] Sum Decomposition

A combinatorial DP recurrence based on adding a number or reducing the target sum.

BaekjoonDPCombinatoricsMath

Algorithms · September 2, 2022

[Baekjoon 7579] App

A knapsack solution indexed by released memory to minimize app deactivation cost.

BaekjoonDPKnapsackOptimization

Algorithms · September 1, 2022

[Baekjoon 12865] Ordinary Knapsack

A one-dimensional 0/1 knapsack DP that iterates weights backward to avoid selecting an item twice.

BaekjoonDPKnapsack

Algorithms · September 1, 2022

[Baekjoon 2580] Sudoku

Fill empty cells with backtracking while tracking numbers used in each row, column, and 3×3 box.

BaekjoonBacktrackingImplementationSudoku

Algorithms · August 30, 2022

[Baekjoon 9663] N-Queen

Place one queen per row, mark attacked cells below it, and restore those marks when backtracking.

BaekjoonBacktrackingBrute forceN-Queen

Algorithms · August 27, 2022

[Baekjoon 1028] Diamond Mine

A Platinum DP solution that expands smaller diamonds and checks all four edges.

BaekjoonDPGrid DPPlatinum

Algorithms · August 26, 2022

[Baekjoon 11444] Fibonacci Number 6

Computing a very large Fibonacci index with fast exponentiation of a 2×2 matrix.

BaekjoonDivide and conquerMatrix exponentiationFibonacci

Algorithms · August 26, 2022

[Baekjoon 2749] Fibonacci Number 3

Use fast matrix exponentiation to compute Fibonacci numbers with a different modulus.

BaekjoonFibonacciDivide and conquerMatrix exponentiation

Algorithms · August 23, 2022

[Baekjoon 17135] Castle Defense

Enumerate archer placements and simulate each game independently.

BaekjoonBrute forceSimulationImplementation

Algorithms · August 20, 2022

[Baekjoon 1153] Four Primes

Precomputing primality and reducing a sum of four primes to searches for pairs.

BaekjoonSieve of EratosthenesPrimesMath

Algorithms · August 17, 2022

[Baekjoon 1016] Square-free Numbers

A segmented sieve that marks multiples of squares within the requested interval.

BaekjoonSieve of EratosthenesMathSegmented sieve

Algorithms · July 18, 2022

[Baekjoon 1644] Sum of Consecutive Primes

Generate primes with a sieve, then search consecutive ranges whose sum matches the target.

BaekjoonPrimesSieve of EratosthenesConsecutive sums

Algorithms · February 22, 2022

[Baekjoon 2798] Blackjack

My first algorithm exercise: checking every combination of three cards.

BaekjoonAlgorithmsBrute forceBlackjack