Rayan Programming Contest 2024 - Selection (Codeforces Round 989, Div. 1 + Div. 2)

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
2034 Rayan Programming Contest 2024 - Selection (Codeforces Round 989, Div. 1 + Div. 2) FINISHED False 10800 43428323 Nov. 30, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 196 ) H Rayan vs. Rayaneh PROGRAMMING dp number theory

Rayan makes his final efforts to win Reyhaneh's heart by claiming he is stronger than Rayaneh (i.e., computer in Persian). To test this, Reyhaneh asks Khwarizmi for help. Khwarizmi explains that a set is integer linearly independent if no element in the set can be written as an integer linear combination of the others. Rayan is given a set of integers each time and must identify one of the largest possible integer linearly independent subsets. Note that a single element is always considered an integer linearly independent subset. An integer linearly combination of (a_1, \ldots, a_k) is any sum of the form (c_1 \cdot a_1 + c_2 \cdot a_2 + \ldots + c_k \cdot a_k) where (c_1, c_2, \ldots, c_k) are integers (which may be zero, positive, or negative). The first line contains an integer (t) ((1 \leq t \leq 100)), the number of test cases. The first line of each test case contains an integer (n) ((1 \leq n \leq 10^5)), the size of the set. The second line contains (n) distinct integers (a_1, a_2, \ldots, a_n) ((1 \leq a_i \leq 10^5)). The sum of (n) over all test cases does not exceed (3 \cdot 10^6). In the first line of each test case print the size of the largest integer linearly independent subset. In the next line, print one such subset in any order. If there are multiple valid subsets, print any one of them. In example 1, (\{4, 6\}) is an integer linearly independent subset. It can be proven that there is no integer linearly independent subset with at least (3) elements. In example 2, (\{35, 21, 30\}) is an integer linearly independent subset because no integer linear combination of any two elements can create the third. There is no integer linearly independent subset with at least (4) elements. In example 3, (\{2, 3, 6\}) is not an integer linearly independent subset since (6) can be written as (6 \cdot 2 + (-2) \cdot 3), which is an integer linear combination of (\{2, 3\}).

Tutorials

Rayan 2024 Selection Round Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
294081941 Rewinding H Nov. 30, 2024, 5:04 p.m. OK C++17 (GCC 7-32) TESTS 34 2890 5017600
294122036 dXqwq H Nov. 30, 2024, 11:51 p.m. OK C++20 (GCC 13-64) TESTS 34 1468 6451200
294086147 A_G H Nov. 30, 2024, 5:17 p.m. OK C++20 (GCC 13-64) TESTS 34 1499 25497600
294112546 omarabdeen04 H Nov. 30, 2024, 8:59 p.m. OK C++20 (GCC 13-64) TESTS 34 1531 28979200
294090587 femboy-wannabe H Nov. 30, 2024, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 34 1671 7372800
294100281 noimi H Nov. 30, 2024, 6:57 p.m. OK C++20 (GCC 13-64) TESTS 34 1796 1331200
294080097 maspy H Nov. 30, 2024, 4:59 p.m. OK C++20 (GCC 13-64) TESTS 34 1999 307200
294091448 antontrygubO_o H Nov. 30, 2024, 5:33 p.m. OK C++20 (GCC 13-64) TESTS 34 2062 38809600
294087678 ugly2333 H Nov. 30, 2024, 5:22 p.m. OK C++20 (GCC 13-64) TESTS 34 2218 27238400
294127539 E869120 H Dec. 1, 2024, 2:11 a.m. OK C++20 (GCC 13-64) TESTS 34 2265 102400
294087654 le0n H Nov. 30, 2024, 5:22 p.m. OK C++20 (GCC 13-64) TESTS 34 2561 3481600
294130052 GJ.Ro H Dec. 1, 2024, 3:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 1483 43212800
294096529 neal H Nov. 30, 2024, 6:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 1671 6451200
294096930 244mhq H Nov. 30, 2024, 6:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 1686 1331200
294097228 MatinAbbasi H Nov. 30, 2024, 6:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 1749 48537600
294090336 errorgorn H Nov. 30, 2024, 5:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 2280 201318400
294132398 GJ.Ro H Dec. 1, 2024, 3:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 2374 16384000
294085834 ksun48 H Nov. 30, 2024, 5:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 2796 19660800
294126485 tkacper H Dec. 1, 2024, 1:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 2843 132812800
294098158 Radewoosh H Nov. 30, 2024, 6:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 34 3031 12083200
294125721 tkacper H Dec. 1, 2024, 1:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 34 3327 150937600

remove filters

Back to search problems