Grading Server Despite running low on oil, the opening ceremony was a great success. Now, the committee is looking forward to the first competition day. But what’s this?…
Vault There are $2M + 1$ kinds of weights, whose mass are $-M, -M + 1, \ldots, M - 1, M$. However, you do not have an infinite number of weights. For each mass $\ell$, th…
Counting Reorders Calculate the number of ways you can reorder the characters of a string so that no two adjacent characters are the same. For example, the answer for aab…
Grid Completion Your task is to create an $n \times n$ grid whose each row and column has exactly one $\texttt A$ and $\texttt B$. Some of the characters have already bee…
Counting Bishops Your task is to count the number of ways $k$ bishops can be placed on an $n \times n$ chessboard so that no two bishops attack each other. Two bishops at…
Raab Game II Consider a two player game where each player has $n$ cards numbered $1, 2, \ldots, n$. On each turn both players place one of their cards on the table. The p…
Filled Subgrid Count II You are given a grid of letters. Your task is to calculate, for each letter, the number of rectangular subgrids whose each letter is the same. $1 \leq n \leq 3000$…
Sliding Window Advertisement A fence consists of $n$ vertical boards. The width of each board is $1$ and their heights may vary. You want to attach a rectangular advertis…
Problem Statement Given an array $a$ of $n$ integers, find out the contents of the array after $k$ bubble sort rounds. $1 \leq n \leq 2 \times 10^5, 0 \leq k \leq 10^9, 1 \leq a_i \leq 10^9$…
The violation of the Bell inequality demonstrates that the classical theories based on local realism cannot completely explain the correlations predicted by quantum mecha…