The 2024 Damascus University Collegiate Programming Contest (DCPC 2024)
13 problems from The 2024 Damascus University Collegiate Programming Contest (DCPC 2024) (contest 105242), difficulty -. 13/13 solutions verified against sample I/O.
The 2024 Damascus University Collegiate Programming Contest (DCPC 2024)
Special | 13 problems | 13/13 verified | Difficulty - | 13m 44s
| # | Problem | Rating | Tags | Accepted | Time | ✓ |
|---|---|---|---|---|---|---|
| A | Prefix GCD | 1m 21s | ✓ | |||
| B | Tree Tour | 1m 13s | ✓ | |||
| C | Powerful String | 51s | ✓ | |||
| D | You Have Been Grid Squared | 1m 17s | ✓ | |||
| E | Replace with MEX | 48s | ✓ | |||
| F | Queries on Distincts | 1m 7s | ✓ | |||
| G | Lexicographically Maximum | 1m 11s | ✓ | |||
| H | Banis Hotel | 1m 22s | ✓ | |||
| I | Minimum XOR | 55s | ✓ | |||
| J | The Square Game | 39s | ✓ | |||
| K | 2.. 3.. 4.. Colorful! Colorful! Colorful! | 1m 4s | ✓ | |||
| L | Median of the Array | 1m 1s | ✓ | |||
| M | Taim and Zingers | 55s | ✓ |
CF 105242D - You Have Been Grid Squared
We are given a square grid of size $n times n$. The first row is fixed: it contains the numbers from 1 to $n$ in order. Every cell below is generated deterministically: each entry is the square of the number directly above it in the same column.
CF 105242E - Replace with MEX
We are given a sequence of integers, and we are allowed to remove exactly one element from it. After removing that element, the remaining elements keep their original order, forming a shorter sequence. On this modified sequence, we look at all prefixes.
CF 105242M - Taim and Zingers
We are given a number of candies, called Zingers, initially held by Kaito. Before any distribution happens, a character named Taim is allowed to secretly take up to k Zingers for himself.
CF 105242A - Prefix GCD
We are given an array and allowed to perform a single operation at most once. The operation selects a contiguous segment, computes the mex of that segment, and then overwrites every element inside the segment with that mex value.
CF 105242C - Powerful String
We are given several independent test cases. Each test case describes a tree, meaning a connected acyclic graph. The task is to decide whether there exists a walk on this tree that visits every node at least once and never more than twice.
CF 105242L - Median of the Array
We are given several test cases, and in each one we start with a list of integers. The task is to split this list into two non-empty groups so that every element belongs to exactly one of the groups.
CF 105242K - 2.. 3.. 4.. Colorful! Colorful! Colorful!
We are given multiple test cases. Each test case consists of a set of points on a 2D plane. Every point has integer coordinates and also a color label.
CF 105242J - The Square Game
We are given a single odd integer n that represents the number of chess games played between two players, both named Ahmad. Every game produces a decisive result, so there are no draws, and each game contributes exactly one win to one of the two players.
CF 105242I - Minimum XOR
We are given an array of integers and then asked many independent queries. Each query provides a value x, and we must consider all pairs of distinct indices (i, j) such that the bitwise OR of the two array values is “compatible” with x, in the sense that every bit that…
CF 105242H - Banis Hotel
We are given a hotel with floors numbered from bottom to top. Each floor has a structural limit that restricts how many guests can be on that floor or any floors above it.
CF 105242G - Lexicographically Maximum
We are given a string of lowercase English letters. We are allowed to perform an operation any number of times, where each operation picks a contiguous substring and compresses it into a single repeated letter determined by how many distinct characters were inside that substring.
CF 105242F - Queries on Distincts
We are given a string of lowercase English letters and many queries, each query focusing on a substring defined by indices $l$ and $r$. For each such range, we first look at which distinct characters appear inside it. Suppose the substring $s[l..
CF 105242B - Tree Tour
We are given a string made of lowercase English letters and a large number of queries, each query specifying a segment of this string. For each segment, we are allowed to choose two positions inside it and swap their characters exactly once.