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 |
---|---|---|---|---|---|---|
1893 | Codeforces Round 908 (Div. 1) | FINISHED | False | 7200 | 37812263 | Nov. 7, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 203 ) | E | Cacti Symphony | PROGRAMMING | combinatorics dfs and similar dp graphs |
B'You are given an undirected connected graph in which any two distinct simple cycles do not have common vertices. Since the graph can be very large, it is given to you in a compressed form: for each edge, you are also given a number d , which indicates that there are d additional vertices on this edge. You need to assign a weight to each vertex and each edge of the graph -- an integer from 1 to 3 . An edge of the graph is called good if the bitwise XOR of the weights of its adjacent vertices is not equal to 0 and not equal to the weight of that edge. Similarly, a vertex of the graph is called good if the bitwise XOR of the weights of its adjacent edges is not equal to 0 and not equal to the weight of that vertex. You need to determine how many ways there are to assign weights to the vertices and edges of the graph so that all vertices and edges are good. Since the answer can be quite large, you need to calculate the remainder of the answer divided by 998 ,244 ,353 . The first line contains two integers n and m -- the number of vertices and the number of edges in the graph ( 2 <= n <= 5 cdot 10^5 , n - 1 <= m <= 10^6 ). Each of the next m lines contains three integers a_i, b_i , and d_i ( 1 <= a_i, b_i <= n , a_i ne b_i , 0 <= d_i <= 10^9 ), indicating that there is an edge in the graph connecting vertices a_i and b_i . Additionally, on this edge, there are d_i additional vertices. It is guaranteed that the given graph is connected, there are no multiple edges, loops, and any two distinct simple cycles of the graph do not have common vertices. Output a single integer -- the answer to the problem modulo 998 ,244 ,353 . In the first test, the graph is a simple cycle of 3 vertices. It can be shown, that there are exactly 12 ways to assign weights, to make all vertexes and edges good. In the second test, the graph has the f'... |
Codeforces Round 908 (Div. 1, Div, 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
231850185 | rainboy | E | Nov. 7, 2023, 7:52 p.m. | OK | GNU C11 | TESTS | 306 | 624 | 74342400 | ||
231825604 | rainboy | E | Nov. 7, 2023, 5:01 p.m. | OK | GNU C11 | TESTS | 306 | 1747 | 112025600 | ||
231884562 | Hanghang007 | E | Nov. 8, 2023, 4:56 a.m. | OK | GNU C++14 | TESTS | 306 | 1014 | 126771200 | ||
231876898 | Hanghang007 | E | Nov. 8, 2023, 3:01 a.m. | OK | GNU C++14 | TESTS | 306 | 1045 | 126668800 | ||
231884502 | Hanghang007 | E | Nov. 8, 2023, 4:55 a.m. | OK | GNU C++14 | TESTS | 306 | 1060 | 126771200 | ||
231803415 | Um_nik | E | Nov. 7, 2023, 4:23 p.m. | OK | GNU C++17 | TESTS | 306 | 982 | 74649600 | ||
231874231 | ITworker_Z | E | Nov. 8, 2023, 2:17 a.m. | OK | GNU C++17 (64) | TESTS | 306 | 467 | 100044800 | ||
231872572 | locsey | E | Nov. 8, 2023, 1:47 a.m. | OK | GNU C++17 (64) | TESTS | 306 | 982 | 132300800 | ||
231868215 | Alfalfa_w | E | Nov. 8, 2023, 12:11 a.m. | OK | GNU C++17 (64) | TESTS | 306 | 1606 | 103628800 | ||
231833815 | Radewoosh | E | Nov. 7, 2023, 5:53 p.m. | OK | GNU C++17 (64) | TESTS | 306 | 2386 | 362905600 | ||
231839797 | ecnerwala | E | Nov. 7, 2023, 6:48 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 639 | 96153600 | ||
231826618 | ecnerwala | E | Nov. 7, 2023, 5:06 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 686 | 96153600 | ||
231863497 | RED_INSIDE | E | Nov. 7, 2023, 10 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 686 | 109772800 | ||
231849553 | sevlll777 | E | Nov. 7, 2023, 7:44 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 841 | 131788800 | ||
231872318 | EnucAl | E | Nov. 8, 2023, 1:43 a.m. | OK | GNU C++20 (64) | TESTS | 306 | 873 | 131788800 | ||
231803775 | AliShahali1382 | E | Nov. 7, 2023, 4:23 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 888 | 163737600 | ||
231888827 | jerry3128 | E | Nov. 8, 2023, 5:53 a.m. | OK | GNU C++20 (64) | TESTS | 306 | 1029 | 134041600 | ||
231804844 | tourist | E | Nov. 7, 2023, 4:23 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 1388 | 233984000 | ||
231788620 | ecnerwala | E | Nov. 7, 2023, 4:10 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 1731 | 142131200 | ||
231817045 | Ormlis | E | Nov. 7, 2023, 4:30 p.m. | OK | GNU C++20 (64) | TESTS | 306 | 2059 | 200396800 |
Back to search problems