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. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 595 ) | F2 | Khayyam's Royal Decree (Hard Version) | PROGRAMMING | combinatorics dp math |
This is the hard 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 5000)) — the number of red rubies, the number of blue sapphires, and the number of scrolls d |
| Rayan 2024 Selection Round Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 294135546 | wzc_IOI_czw | F2 | Dec. 1, 2024, 4:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 374 | 6553600 | ||
| 294129326 | DeadlyCritic | F2 | Dec. 1, 2024, 2:51 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 406 | 16076800 | ||
| 294104433 | Kilani | F2 | Nov. 30, 2024, 7:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 436 | 6041600 | ||
| 294088434 | ko_osaga | F2 | Nov. 30, 2024, 5:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 546 | 8499200 | ||
| 294085590 | syzf2222 | F2 | Nov. 30, 2024, 5:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 577 | 208896000 | ||
| 294137362 | ByeWorld512 | F2 | Dec. 1, 2024, 5:10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 578 | 8192000 | ||
| 294081339 | alireza_kaviani | F2 | Nov. 30, 2024, 5:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 686 | 217395200 | ||
| 294086072 | AliShahali1382 | F2 | Nov. 30, 2024, 5:17 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 952 | 26112000 | ||
| 294079091 | Kazumin | F2 | Nov. 30, 2024, 4:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 999 | 6553600 | ||
| 294089564 | chenlinxuan0226 | F2 | Nov. 30, 2024, 5:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 999 | 8192000 | ||
| 294122740 | ttamx | F2 | Dec. 1, 2024, 12:10 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 125 | 7987200 | ||
| 294131752 | ayingna | F2 | Dec. 1, 2024, 3:36 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 140 | 8499200 | ||
| 294129363 | qiuzx | F2 | Dec. 1, 2024, 2:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 140 | 9625600 | ||
| 294129089 | marvinthang | F2 | Dec. 1, 2024, 2:46 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 140 | 12492800 | ||
| 294081008 | Karuna | F2 | Nov. 30, 2024, 5:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 156 | 3276800 | ||
| 294081606 | natsugiri | F2 | Nov. 30, 2024, 5:03 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 156 | 12083200 | ||
| 294134737 | Yam | F2 | Dec. 1, 2024, 4:27 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 171 | 3276800 | ||
| 294080815 | zjy2008 | F2 | Nov. 30, 2024, 5:01 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 171 | 5939200 | ||
| 294129557 | tas6 | F2 | Dec. 1, 2024, 2:56 a.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 171 | 6144000 | ||
| 294103462 | bashkort | F2 | Nov. 30, 2024, 7:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 21 | 171 | 8396800 | ||
| 294133894 | lcyxds | F2 | Dec. 1, 2024, 4:12 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 125 | 3379200 | ||
| 294122143 | Markadiusz | F2 | Nov. 30, 2024, 11:54 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 140 | 4505600 | ||
| 294131359 | prairie2022 | F2 | Dec. 1, 2024, 3:29 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 140 | 6451200 | ||
| 294127151 | MYFJCHX | F2 | Dec. 1, 2024, 2:02 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 155 | 58265600 | ||
| 294090568 | JettyOller | F2 | Nov. 30, 2024, 5:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 156 | 102400 | ||
| 294080352 | dolbaeb | F2 | Nov. 30, 2024, 5 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 202 | 3379200 | ||
| 294135698 | wakaka | F2 | Dec. 1, 2024, 4:44 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 217 | 2252800 | ||
| 294078342 | neal | F2 | Nov. 30, 2024, 4:53 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 218 | 9728000 | ||
| 294137386 | w33hw3 | F2 | Dec. 1, 2024, 5:11 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 218 | 16896000 | ||
| 294123940 | SireGR | F2 | Dec. 1, 2024, 12:44 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 250 | 6451200 | ||
| 294102723 | rainboy | F2 | Nov. 30, 2024, 7:16 p.m. | OK | GNU C11 | TESTS | 21 | 467 | 4915200 | ||
| 294100413 | __baozii__ | F2 | Nov. 30, 2024, 6:59 p.m. | OK | Go | TESTS | 21 | 359 | 6963200 | ||
| 294103857 | Dukkha | F2 | Nov. 30, 2024, 7:26 p.m. | OK | Java 21 | TESTS | 21 | 1858 | 1433600 | ||
| 294130381 | Little_Sheep_Yawn | F2 | Dec. 1, 2024, 3:11 a.m. | OK | PyPy 3-64 | TESTS | 21 | 687 | 13107200 | ||
| 294085085 | dyppp | F2 | Nov. 30, 2024, 5:14 p.m. | OK | PyPy 3-64 | TESTS | 21 | 1577 | 16793600 |
Back to search problems