Fading Coder

One Final Commit for the Last Sprint

HTTP Header Parsing and Tree-Based MEX Queries in Competitive Programming

This article presents concise, robust solutions to two distinct algorithmic problems from a competitive programming context: parsing and decoding HTTP-like header structures using Huffman tree reconstruction, and computing the minimum excluded value (MEX) on tree paths via persistent segment trees....

Implementing Solutions for CSP 2020 Problems

Power Decomposition Given an integer n, output its representation as a sum of distinct powers of two in descending order, or -1 if n is odd. #include <iostream> using namespace std; int main() { int val; cin >> val; if (val % 2 != 0) { cout << "-1"; return 0; } for (int e...