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 |
|---|---|---|---|---|---|---|
| 2029 | Refact.ai Match 1 (Codeforces Round 985) | FINISHED | False | 10800 | 45242723 | Nov. 9, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 110 ) | H | Message Spread | PROGRAMMING | bitmasks combinatorics dp |
Given is an undirected graph with (n) vertices and (m) edges. Each edge connects two vertices ((u, v)) and has a probability of (\frac{p}{q}) of appearing each day. Initially, vertex (1) has a message. At the end of the day, a vertex has a message if and only if itself or at least one of the vertices adjacent to it had the message the day before. Note that each day, each edge chooses its appearance independently. Calculate the expected number of days before all the vertices have the message, modulo (998\,244\,353). The first line contains two integers (n) and (m) ((1\leq n\leq 21), (n-1\leq m\leq\frac{n(n-1)}{2})). Then (m) lines follow, each containing four integers (u), (v), (p), and (q) ((1\leq u\neq v\leq n), (1\leq p<q<998\,244\,353), (\gcd(p,q)=1)) — there is an undirected edge between (u) and (v), and it has a probability of appearance of (\frac{p}{q}) each day. It is guaranteed that there are no self-loops or multiple-edges in the graph and that the graph is connected if all of the edges appear. Additional constraint in the input: Let (g_{i,j}) be the probability of appearance of the edge between (i) and (j) ((g_{i,j}=0) if there is no edge between (i) and (j)). It is guaranteed that for any (S\subseteq\{1,2,\ldots,n\}) ((|S|\ge 1)), () \prod_{i\in S}\left(\prod_{j\in\{1,2,\ldots,n\}\setminus S}(1-g_{i,j})\right)\not\equiv1\pmod{998\,244\,353}. () Print a single integer in the only line of the output — the expected number of days, 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{ |
| Refact.ai Match 1 (Codeforces Round 985) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 290785349 | hos.lyric | H | Nov. 9, 2024, 8:57 p.m. | OK | C++17 (GCC 7-32) | TESTS | 69 | 6061 | 210944000 | ||
| 290785367 | hos.lyric | H | Nov. 9, 2024, 8:57 p.m. | OK | C++17 (GCC 7-32) | TESTS | 69 | 6156 | 210944000 | ||
| 290785375 | hos.lyric | H | Nov. 9, 2024, 8:57 p.m. | OK | C++20 (GCC 13-64) | TESTS | 69 | 5953 | 210636800 | ||
| 290806378 | nbhoanh09hanoi | H | Nov. 10, 2024, 4:55 a.m. | OK | C++20 (GCC 13-64) | TESTS | 69 | 7671 | 4710400 | ||
| 290771421 | StellarSpecter | H | Nov. 9, 2024, 6:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 69 | 7781 | 4710400 | ||
| 290757456 | hos.lyric | H | Nov. 9, 2024, 4:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 69 | 7936 | 4710400 | ||
| 290765761 | jiangly | H | Nov. 9, 2024, 5:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 69 | 5374 | 206643200 | ||
| 290787780 | Benq | H | Nov. 9, 2024, 9:41 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 69 | 6203 | 286720000 | ||
| 290773488 | Ion_Gravirei | H | Nov. 9, 2024, 6:36 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 69 | 7499 | 4812800 | ||
| 290751120 | Benq | H | Nov. 9, 2024, 4:39 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 69 | 11327 | 4812800 | ||
| 290781610 | rainboy | H | Nov. 9, 2024, 8:03 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 69 | 11343 | 596787200 |
Back to search problems