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
( 887 ) F1 Khayyam's Royal Decree (Easy Version) PROGRAMMING combinatorics dp math

This is the easy version of the problem. The only differences between the two versions are the constraints on (k) and the sum of (k). In ancient Persia, Khayyam , a clever merchant and mathematician, is playing a game with his prized treasure chest containing (n) red rubies worth (2) dinars each and (m) blue sapphires worth (1) dinar each. He also has a satchel, which starts empty, and (k) scrolls with pairs ((r_1, b_1), (r_2, b_2), \ldots, (r_k, b_k)) that describe special conditions. The game proceeds for (n + m) turns as follows: Khayyam draws a gem uniformly at random from the chest. He removes the gem from the chest and places it in his satchel. If there exists a scroll (i) ((1 \leq i \leq k)) such that the chest contains exactly (r_i) red rubies and (b_i) blue sapphires, Khayyam receives a royal decree that doubles the value of all the gems in his satchel as a reward for achieving a special configuration. Note that the value of some gems might be affected by multiple decrees, and in that case the gems' value is doubled multiple times. Determine the expected value of Khayyam's satchel at the end of the game, modulo (998,244,353). Formally, let (M = 998,244,353). It can be shown that the exact answer can be expressed as an irreducible fraction (\frac{p}{q}), where (p) and (q) are integers and (q \not \equiv 0 \pmod{M}). Output the integer equal to (p \cdot q^{-1} \bmod M). In other words, output such an integer (x) that (0 \le x < M) and (x \cdot q \equiv p \pmod{M}). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 500)). The description of the test cases follows. The first line of each test case contains three integers (n), (m), and (k) ((1 \leq n, m \leq 2 \cdot 10^5), (0 \leq k \leq 500)) — the number of red rubies, the number of blue sapphires, and the number of scrolls de

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
294135551 wzc_IOI_czw F1 Dec. 1, 2024, 4:42 a.m. OK C++17 (GCC 7-32) TESTS 15 62 6553600
294090940 Emma194 F1 Nov. 30, 2024, 5:31 p.m. OK C++17 (GCC 7-32) TESTS 15 92 19558400
294085320 syzf2222 F1 Nov. 30, 2024, 5:15 p.m. OK C++17 (GCC 7-32) TESTS 15 92 208896000
294085925 AliShahali1382 F1 Nov. 30, 2024, 5:17 p.m. OK C++17 (GCC 7-32) TESTS 15 93 26112000
294110785 patak F1 Nov. 30, 2024, 8:37 p.m. OK C++17 (GCC 7-32) TESTS 15 109 16179200
294132119 _chroneZ F1 Dec. 1, 2024, 3:43 a.m. OK C++17 (GCC 7-32) TESTS 15 218 5939200
294089496 chenlinxuan0226 F1 Nov. 30, 2024, 5:27 p.m. OK C++17 (GCC 7-32) TESTS 15 218 8192000
294089652 ltf0501 F1 Nov. 30, 2024, 5:28 p.m. OK C++17 (GCC 7-32) TESTS 15 311 3276800
294086548 Iztrx F1 Nov. 30, 2024, 5:19 p.m. OK C++17 (GCC 7-32) TESTS 15 390 10547200
294079309 Kazumin F1 Nov. 30, 2024, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 15 421 6553600
294123229 ssk4988 F1 Dec. 1, 2024, 12:24 a.m. OK C++20 (GCC 13-64) TESTS 15 61 16896000
294091396 MCPlayer542 F1 Nov. 30, 2024, 5:32 p.m. OK C++20 (GCC 13-64) TESTS 15 62 3276800
294078472 kaiboy F1 Nov. 30, 2024, 4:54 p.m. OK C++20 (GCC 13-64) TESTS 15 62 5017600
294096997 everflame F1 Nov. 30, 2024, 6:33 p.m. OK C++20 (GCC 13-64) TESTS 15 62 6451200
294132538 0x0002 F1 Dec. 1, 2024, 3:50 a.m. OK C++20 (GCC 13-64) TESTS 15 62 16076800
294088910 ppltn F1 Nov. 30, 2024, 5:26 p.m. OK C++20 (GCC 13-64) TESTS 15 77 102400
294101543 zacharychao F1 Nov. 30, 2024, 7:07 p.m. OK C++20 (GCC 13-64) TESTS 15 77 102400
294079240 caf_sq F1 Nov. 30, 2024, 4:56 p.m. OK C++20 (GCC 13-64) TESTS 15 77 1126400
294134745 Yam F1 Dec. 1, 2024, 4:27 a.m. OK C++20 (GCC 13-64) TESTS 15 77 3276800
294084311 BEAR0131 F1 Nov. 30, 2024, 5:12 p.m. OK C++20 (GCC 13-64) TESTS 15 77 5017600
294126121 revengeMik3 F1 Dec. 1, 2024, 1:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 15 46 2867200
294133903 lcyxds F1 Dec. 1, 2024, 4:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 15 46 3379200
294133517 prairie2022 F1 Dec. 1, 2024, 4:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 15 62 6451200
294085686 LinZhengYu F1 Nov. 30, 2024, 5:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 77 6451200
294137404 w33hw3 F1 Dec. 1, 2024, 5:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 15 77 16896000
294080399 YuJiahe F1 Nov. 30, 2024, 5 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 92 3379200
294101487 MAKMED1337 F1 Nov. 30, 2024, 7:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 92 6451200
294087282 shiven F1 Nov. 30, 2024, 5:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 92 12083200
294090714 Robsob F1 Nov. 30, 2024, 5:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 108 8089600
294100254 415411 F1 Nov. 30, 2024, 6:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 15 109 20070400
294083771 KumaTachiRen F1 Nov. 30, 2024, 5:10 p.m. OK C# 8 TESTS 15 843 8192000
294102895 rainboy F1 Nov. 30, 2024, 7:18 p.m. OK GNU C11 TESTS 15 77 4915200
294100442 __baozii__ F1 Nov. 30, 2024, 6:59 p.m. OK Go TESTS 15 140 6553600
294103919 Dukkha F1 Nov. 30, 2024, 7:27 p.m. OK Java 21 TESTS 15 296 614400
294119876 fetetriste F1 Nov. 30, 2024, 10:55 p.m. OK Java 8 TESTS 15 1561 0
294084992 dyppp F1 Nov. 30, 2024, 5:14 p.m. OK PyPy 3-64 TESTS 15 186 15360000
294130412 Little_Sheep_Yawn F1 Dec. 1, 2024, 3:12 a.m. OK PyPy 3-64 TESTS 15 233 12185600

remove filters

Back to search problems