Codeforces Round 990 (Div. 1)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
2046 Codeforces Round 990 (Div. 1) FINISHED False 7200 43198523 Dec. 3, 2024, 6:25 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 89 ) E2 Cheops and a Contest (Hard Version) PROGRAMMING greedy

This is the hard version of the problem. The difference between the versions is that in this version, (m) is arbitrary. You can hack only if you solved all versions of this problem. There is a problem-solving competition in Ancient Egypt with (n) participants, numbered from (1) to (n). Each participant comes from a certain city; the cities are numbered from (1) to (m). There is at least one participant from each city. The (i)-th participant has strength (a_i), specialization (s_i), and wisdom (b_i), so that (b_i \ge a_i). Each problem in the competition will have a difficulty (d) and a unique topic (t). The (i)-th participant will solve the problem if (a_i \ge d), i.e., their strength is not less than the problem's difficulty, or (s_i = t), and (b_i \ge d), i.e., their specialization matches the problem's topic, and their wisdom is not less than the problem's difficulty. Cheops wants to choose the problems in such a way that each participant from city (i) will solve strictly more problems than each participant from city (j), for all (i < j). Please find a set of at most (5n) problems, where the topics of all problems are distinct , so that Cheops' will is satisfied, or state that it is impossible. Each test contains multiple test cases. The first line contains the number of test cases (T) ((1 \le T \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n), (m) ((2 \le m \le n \le 3 \cdot {10}^5)) — the number of participants and the number of cities. The following (n) lines describe the participants. The (i)-th line contains three integers —(a_i), (b_i), (s_i) ((0 \le a_i, b_i, s_i \le {10}^9), (a_i \le b_i)) — strength, wisdom, and specialization of the (i)-th participant, respectively. The next (m) lines describe the cities. In the (i)-th line, the first num

Tutorials

Разбор Codeforces Round 990 (Div. 2 + Div. 1)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
294584009 jiangly E2 Dec. 3, 2024, 8:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 58 1093 88576000
294694727 Szoboszlai10 E2 Dec. 3, 2024, 10:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 58 1140 53862400
294694784 peti1234 E2 Dec. 3, 2024, 10:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 58 1140 53964800

remove filters

Back to search problems