#binary search
CF 932B - Recursive Queries Rating: 1300 Tags: binary search, data structures, dfs and similar Model: gpt-5-3-mini Solve time: 1m 34s Verified: no (0/1 samples) Share: https://chatgpt.com/share/6a32e3b7-e7dc-83ec-a17b-6d7184217e41 Solution Problem Understanding We are given a function defined on positive integers that repeatedly transforms a number by taking its digit product and then collapsing it again in a recursive way until a single digit remains. That final digit is what we call...
CF 958E2 - Guard Duty (medium) Rating: 2200 Tags: binary search, dp, greedy, sortings Model: gpt-5-3-mini Solve time: 3m 26s Verified: no (0/1 samples) Share: https://chatgpt.com/share/6a339e66-d274-83ec-9c8a-9aa9396149de Solution Problem Understanding We are given a strictly increasing sequence of time moments when Heidi temporarily leaves hyperspace. These moments are the only valid endpoints at which meetings can begin or end. Heidi must organize exactly $K$ disjoint meetings, where each meeting is defined...
CF 1070E - Getting Deals Done Rating: 2100 Tags: binary search, data structures Model: gpt-5-3-mini Solve time: 1m 33s Verified: no (0/1 samples) Share: https://chatgpt.com/share/6a33bee1-54b8-83ec-8078-dc30aeae57f9 Solution Problem Understanding We are given a sequence of tasks, each with a processing time. Polycarp scans tasks from left to right and decides whether to execute or skip each one based on a threshold value $d$. Any task with duration greater than $d$ is...
CF 958F2 - Lightsabers (medium) Rating: 1800 Tags: binary search, two pointers Model: gpt-5-3-mini Solve time: 2m 35s Verified: no (0/1 samples) Share: https://chatgpt.com/share/6a339f05-474c-83ec-8348-d5aef0244721 Solution Problem Understanding We are given a line of Jedi, each Jedi wearing a lightsaber of one of several colors. We are also given a target requirement: for every color, we want to see a fixed number of knights of that color. The goal is not...
CF 932D - Tree Rating: 2200 Tags: binary search, dp, trees Model: gpt-5-3-mini Solve time: 1m 28s Verified: yes (1/1 samples) Share: https://chatgpt.com/share/6a327666-dc20-83ec-bfaf-a06758f8815b Solution Problem Understanding We maintain a rooted tree that grows over time. The root is node 1 with weight 0. Each update query can attach a new node under an existing node, and each such node has a fixed weight. Over time, the structure becomes a rooted...
CF 1322B - Present Rating: 2100 Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Model: gpt-5-3-mini Solve time: 1m 28s Verified: yes (1/1 samples) Share: https://chatgpt.com/share/6a2deae4-fc9c-83ec-aeba-66f8cbbf4563 Solution Problem Understanding We are given an array of integers, and we consider every unordered pair of distinct elements. For each pair, we compute their sum. After collecting all these pairwise sums, instead of summing or minimizing them, we combine them using...
CF 1323B - Count Subrectangles Rating: 1500 Tags: binary search, greedy, implementation Model: gpt-5-3-mini Solve time: 3m 30s Verified: yes (1/1 samples) Share: https://chatgpt.com/share/6a2ded2f-7b30-83ec-ae4c-241598b69c4b Solution Problem Understanding The matrix in this problem is not arbitrary. Every cell is determined by a simple outer-product rule: row i is either fully “active” or fully “inactive” depending on whether $a_i$ is 1 or 0, and column j is similarly controlled by $b_j$. A...