Codeforces Round 891 (Div. 3)

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
1857 Codeforces Round 891 (Div. 3) FINISHED False 8100 45761063 Aug. 7, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4655 ) G Counting Graphs PROGRAMMING combinatorics divide and conquer ds graphs greedy sortings

B'Given a tree consisting of n vertices. A tree is a connected undirected graph without cycles. Each edge of the tree has its weight, w_i . Your task is to count the number of different graphs that satisfy all four conditions: Two graphs are considered different if their sets of edges are different, taking into account the weights of the edges. The answer can be large, output it modulo 998244353 . The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and S ( 2 <= n <= 2 cdot 10^5, 1 <= S <= 10^9 ) -- the number of vertices and the upper bound of the weights. Then follow n-1 lines describing the tree, the i -th line contains three integers u_i , v_i , and w_i ( 1 <= u_i,v_i <= n, u_i ne v_i, 1 <= w_i <= S ) -- an edge in the tree with weight w_i . It is guaranteed that the sum of n for all tests does not exceed 2 cdot 10^5 . For each test, output the number of different graphs that satisfy the conditions, modulo 998244353 . In the first sample, there is only one graph, which is the given tree. In the second samle, the given tree looks like this: '...

Tutorials

119134

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
217748797 MenezesDM G Aug. 7, 2023, 5:49 p.m. OK GNU C11 TESTS 34 171 3993600
217783239 MasterCactus G Aug. 8, 2023, 1:59 a.m. OK GNU C++14 TESTS 34 124 16896000
217783013 zhangzhimo G Aug. 8, 2023, 1:57 a.m. OK GNU C++14 TESTS 34 124 24883200
217776869 Joey_c G Aug. 8, 2023, 12:28 a.m. OK GNU C++14 TESTS 34 156 10444800
217803093 Joey_c G Aug. 8, 2023, 4:08 a.m. OK GNU C++14 TESTS 34 156 10444800
217780257 wsday G Aug. 8, 2023, 1:24 a.m. OK GNU C++14 TESTS 34 171 10444800
217748087 WinResearcher G Aug. 7, 2023, 5:44 p.m. OK GNU C++14 TESTS 34 171 10444800
217781685 hzy99999 G Aug. 8, 2023, 1:42 a.m. OK GNU C++14 TESTS 34 171 10444800
217747219 lichenyu_ac G Aug. 7, 2023, 5:38 p.m. OK GNU C++14 TESTS 34 171 11161600
217773396 zltzlt G Aug. 7, 2023, 11:04 p.m. OK GNU C++14 TESTS 34 171 14438400
217773478 zltzlt G Aug. 7, 2023, 11:06 p.m. OK GNU C++14 TESTS 34 171 14438400
217812887 thunopro G Aug. 8, 2023, 6 a.m. OK GNU C++17 TESTS 34 171 10444800
217745105 scutsky G Aug. 7, 2023, 5:25 p.m. OK GNU C++17 TESTS 34 171 11161600
217763893 CSHwang G Aug. 7, 2023, 8:01 p.m. OK GNU C++17 TESTS 34 186 11161600
217745809 waiittt G Aug. 7, 2023, 5:29 p.m. OK GNU C++17 TESTS 34 186 14438400
217742055 shstyle G Aug. 7, 2023, 5:09 p.m. OK GNU C++17 TESTS 34 187 54476800
217759132 timg8710 G Aug. 7, 2023, 7:12 p.m. OK GNU C++17 TESTS 34 202 4300800
217797268 wjwzbdx G Aug. 8, 2023, 3:03 a.m. OK GNU C++17 TESTS 34 202 5632000
217755847 TreaBoy G Aug. 7, 2023, 6:43 p.m. OK GNU C++17 TESTS 34 202 10444800
217799779 zhaopipichishi G Aug. 8, 2023, 3:30 a.m. OK GNU C++17 TESTS 34 202 10444800
217783883 knightzzz1 G Aug. 8, 2023, 2:07 a.m. OK GNU C++17 TESTS 34 202 11161600
217776004 shiro53 G Aug. 8, 2023, 12:12 a.m. OK GNU C++17 (64) TESTS 34 109 3993600
217800091 shuoxuanli G Aug. 8, 2023, 3:34 a.m. OK GNU C++17 (64) TESTS 34 124 3993600
217746632 stan23456 G Aug. 7, 2023, 5:34 p.m. OK GNU C++17 (64) TESTS 34 124 3993600
217809401 alif_cse_ju G Aug. 8, 2023, 5:25 a.m. OK GNU C++17 (64) TESTS 34 124 3993600
217776055 enslaved G Aug. 8, 2023, 12:13 a.m. OK GNU C++17 (64) TESTS 34 124 4812800
217745073 Carl_Hu G Aug. 7, 2023, 5:25 p.m. OK GNU C++17 (64) TESTS 34 124 5222400
217772982 wqweto G Aug. 7, 2023, 10:55 p.m. OK GNU C++17 (64) TESTS 34 124 5222400
217754278 scotchtape13 G Aug. 7, 2023, 6:29 p.m. OK GNU C++17 (64) TESTS 34 124 6451200
217783019 LXH-cat G Aug. 8, 2023, 1:57 a.m. OK GNU C++17 (64) TESTS 34 124 16793600
217773595 Hytidel G Aug. 7, 2023, 11:09 p.m. OK GNU C++17 (64) TESTS 34 124 16793600
217779971 cmk666 G Aug. 8, 2023, 1:20 a.m. OK GNU C++20 (64) TESTS 34 46 8499200
217750253 ItzDesert G Aug. 7, 2023, 5:59 p.m. OK GNU C++20 (64) TESTS 34 93 7168000
217750814 SiRBruce G Aug. 7, 2023, 6:02 p.m. OK GNU C++20 (64) TESTS 34 108 3993600
217749795 SiRBruce G Aug. 7, 2023, 5:55 p.m. OK GNU C++20 (64) TESTS 34 108 3993600
217775028 cosenza G Aug. 7, 2023, 11:47 p.m. OK GNU C++20 (64) TESTS 34 108 3993600
217758581 MDSPro G Aug. 7, 2023, 7:07 p.m. OK GNU C++20 (64) TESTS 34 108 5222400
217779728 5af G Aug. 8, 2023, 1:17 a.m. OK GNU C++20 (64) TESTS 34 108 7987200
217755921 BlankYang G Aug. 7, 2023, 6:44 p.m. OK GNU C++20 (64) TESTS 34 108 8806400
217786557 sigma-yyf G Aug. 8, 2023, 2:37 a.m. OK GNU C++20 (64) TESTS 34 108 9420800
217798492 Houyunfei G Aug. 8, 2023, 3:15 a.m. OK GNU C++20 (64) TESTS 34 108 11980800
217798237 minibin G Aug. 8, 2023, 3:13 a.m. OK Java 11 TESTS 34 436 11468800
217755573 dzhi G Aug. 7, 2023, 6:41 p.m. OK Java 11 TESTS 34 888 39936000
217754846 dzhi G Aug. 7, 2023, 6:34 p.m. OK Java 11 TESTS 34 1465 43622400
217742490 hiromi_ayase G Aug. 7, 2023, 5:11 p.m. OK Java 17 TESTS 34 499 8499200
217799389 cosenza G Aug. 8, 2023, 3:26 a.m. OK Java 17 TESTS 34 608 16691200
217810651 UniversalAdmin G Aug. 8, 2023, 5:38 a.m. OK Java 8 TESTS 34 421 6246400
217810936 UniversalAdmin G Aug. 8, 2023, 5:41 a.m. OK Java 8 TESTS 34 467 6246400
217777011 dylan1006498 G Aug. 8, 2023, 12:31 a.m. OK PyPy 3 TESTS 34 1091 38707200
217741767 dylan1006498 G Aug. 7, 2023, 5:08 p.m. OK PyPy 3 TESTS 34 1216 28979200
217750302 skhan_org G Aug. 7, 2023, 5:59 p.m. OK PyPy 3-64 TESTS 34 748 90828800
217765234 RobinFromTheHood G Aug. 7, 2023, 8:17 p.m. OK PyPy 3-64 TESTS 34 764 41369600
217809351 gardengnome G Aug. 8, 2023, 5:24 a.m. OK PyPy 3-64 TESTS 34 779 42393600
217759987 SoleProprietor G Aug. 7, 2023, 7:21 p.m. OK PyPy 3-64 TESTS 34 795 41676800
217798616 gardengnome G Aug. 8, 2023, 3:17 a.m. OK PyPy 3-64 TESTS 34 795 44851200
217799878 gardengnome G Aug. 8, 2023, 3:31 a.m. OK PyPy 3-64 TESTS 34 826 38502400
217776218 Little_Sheep_Yawn G Aug. 8, 2023, 12:16 a.m. OK PyPy 3-64 TESTS 34 826 54169600
217800152 gardengnome G Aug. 8, 2023, 3:34 a.m. OK PyPy 3-64 TESTS 34 857 44851200
217804112 b-baka G Aug. 8, 2023, 4:22 a.m. OK PyPy 3-64 TESTS 34 1076 41574400
217768229 AyuAnchor G Aug. 7, 2023, 9:06 p.m. OK PyPy 3-64 TESTS 34 1153 38502400
217765951 tesfaymebre G Aug. 7, 2023, 8:26 p.m. OK Python 3 TESTS 34 1200 47820800
217776812 haihamabossu G Aug. 8, 2023, 12:27 a.m. OK Rust 2021 TESTS 34 140 11059200
217741167 robostac G Aug. 7, 2023, 5:05 p.m. OK Rust 2021 TESTS 34 140 11161600

remove filters

Back to search problems