Fading Coder

One Final Commit for the Last Sprint

NOIP 2013 Day 1 Problem Solutions

Circular Position Shift After Exponential Rounds Given n children (indexed 0 to n-1) seated in a circle, each initially at position equal to their index. Each round, the child at position i moves clockwise to position (i + m) mod n. After 10^k rounds, determine the final position of child x. Input F...

Efficient Techniques for 2D Point Counting

Given $n$ points $(x_i, y_i)$ and $m$ rectangles, determine the number of points inside each rectangle. Solution Approach The problem requires counting points satisfying $l_j \le x_i \le r_j$ and $d_j \le y_i \le u_j$. By applying inclusion-exclusion, the count for a rectangle can be expressed as: $...