Lanqiao Cup Chessboard Flip Problem (Java Implementation)
Problem Statement
We have an n×n chessbaord where every cell starts as white, represneted by the integer 0. We perform m flip operations: each operation inverts the color of all cells in a rectangular subregion bounded by rows x1 to x2 and columns y1 to y2. After completing all operation, output the final color state of each cell, with 0 indica ...
Posted on Fri, 21 Aug 2026 16:15:55 +0000 by psymonic
Determine the Day of the Week After 20^22 Days (Lanqiao Cup 2022 Provincial Problem)
Problem Description
Given that today is Saturday, determine which day of the week it will be after 20^22 days. Note that days are represented as 1 (Monday) through 7 (Sunday).
Approach
This problem can be efficiently solved using modular arithmetic to avoid computing the extremely large value of 20^22 directly. Since the week cycles every 7 day ...
Posted on Sun, 31 May 2026 17:12:21 +0000 by dkphp2