Codeforces Round 869 (Div. 1)

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
1817 Codeforces Round 869 (Div. 1) FINISHED False 8100 54401063 April 29, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4264 ) B Fish Graph PROGRAMMING brute force constructive algorithms dfs and similar graphs trees

B'You are given a simple undirected graph with n nodes and m edges. Note that the graph is not necessarily connected. The nodes are labeled from 1 to n . We define a graph to be a Fish Graph if it contains a simple cycle with a special node u belonging to the cycle. Apart from the edges in the cycle, the graph should have exactly 2 extra edges. Both edges should connect to node u , but they should not be connected to any other node of the cycle. Determine if the graph contains a subgraph that is a Fish Graph, and if so, find any such subgraph. In this problem, we define a subgraph as a graph obtained by taking any subset of the edges of the original graph. The first line of input contains the integer t ( 1 <= q t <= q 1000 ), the number of test cases. The description of test cases follows. The first line of each test case contains two integers, n and m ( 1 <= n, m <= 2 ,000 ) -- the number of nodes and the number of edges. Each of the next m lines contains the description of an edge. Each line contains two integers u_i and v_i ( 1 <= q u_i, v_i <= q n , u_i neq v_i ) -- an edge connects node u_i to node v_i . It is guaranteed that no two edges connect the same unordered pair of nodes. Furthermore, it is guaranteed that the sum of n and the sum of m over all test cases both do not exceed 2 ,000 . For each testcase, output "YES" if the graph contains a subgraph that is a Fish Graph, otherwise print "NO". If the answer is "YES", on the following lines output a description of the subgraph. The first line of the description contains one integer k -- the number of edges of the subgraph. On the next k lines, output the edges of the chosen subgraph. Each of the k lines should contains two integers u and v ( 1 <= u, v <= n , u neq v ) -- the edge between u and v belongs to the subgraph. T'...

Tutorials

Codeforces Round #869 (Div.1, Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
203940069 LeonidR B April 29, 2023, 3:46 p.m. OK C# 10 TESTS 29 62 1740800
203931059 mban259 B April 29, 2023, 3:19 p.m. OK C# 10 TESTS 29 62 5632000
203928580 Gassa B April 29, 2023, 3:13 p.m. OK D TESTS 29 31 4403200
203932277 chro4896 B April 29, 2023, 3:22 p.m. OK GNU C11 TESTS 29 31 102400
203931785 Iamjuruo B April 29, 2023, 3:21 p.m. OK GNU C11 TESTS 29 31 102400
203974154 rainboy B April 29, 2023, 7:29 p.m. OK GNU C11 TESTS 29 31 307200
203943708 jiangtaizhe001 B April 29, 2023, 3:58 p.m. OK GNU C++14 TESTS 29 15 102400
203932859 yyyyxh329 B April 29, 2023, 3:24 p.m. OK GNU C++14 TESTS 29 15 102400
203944085 by_chance B April 29, 2023, 3:59 p.m. OK GNU C++14 TESTS 29 15 204800
203927553 busamate B April 29, 2023, 3:10 p.m. OK GNU C++14 TESTS 29 15 204800
203962197 rfpermen B April 29, 2023, 5:33 p.m. OK GNU C++14 TESTS 29 15 307200
203953094 steven144 B April 29, 2023, 4:32 p.m. OK GNU C++14 TESTS 29 15 307200
203940062 Kalptaru B April 29, 2023, 3:46 p.m. OK GNU C++14 TESTS 29 15 307200
203963451 KurashinaAsuka B April 29, 2023, 5:43 p.m. OK GNU C++14 TESTS 29 15 307200
203973424 Google12 B April 29, 2023, 7:20 p.m. OK GNU C++14 TESTS 29 15 307200
203994749 cdxcdxcdxcdx B April 30, 2023, 2:52 a.m. OK GNU C++14 TESTS 29 15 307200
203923298 xuanxuan002 B April 29, 2023, 3 p.m. OK GNU C++17 TESTS 29 15 102400
203949640 crabcrabcrab B April 29, 2023, 4:20 p.m. OK GNU C++17 TESTS 29 15 102400
203940117 Natsuzora B April 29, 2023, 3:46 p.m. OK GNU C++17 TESTS 29 15 204800
203933183 AlexanderL B April 29, 2023, 3:25 p.m. OK GNU C++17 TESTS 29 15 204800
203929319 YahiaSherif B April 29, 2023, 3:14 p.m. OK GNU C++17 TESTS 29 15 204800
203949867 ssk4988 B April 29, 2023, 4:21 p.m. OK GNU C++17 TESTS 29 15 204800
203948090 pp_orange B April 29, 2023, 4:14 p.m. OK GNU C++17 TESTS 29 15 204800
203981713 batmend_kh B April 29, 2023, 9:29 p.m. OK GNU C++17 TESTS 29 15 204800
203996156 LGXXGL B April 30, 2023, 3:23 a.m. OK GNU C++17 TESTS 29 15 307200
203997422 Kognition B April 30, 2023, 3:50 a.m. OK GNU C++17 TESTS 29 15 307200
203933737 Lawali B April 29, 2023, 3:27 p.m. OK GNU C++17 (64) TESTS 29 0 512000
203925605 crashed B April 29, 2023, 3:05 p.m. OK GNU C++17 (64) TESTS 29 15 0
203922988 zihouzhong B April 29, 2023, 2:59 p.m. OK GNU C++17 (64) TESTS 29 15 102400
203924175 kotatsugame B April 29, 2023, 3:02 p.m. OK GNU C++17 (64) TESTS 29 15 102400
203924462 IceKnight1093 B April 29, 2023, 3:02 p.m. OK GNU C++17 (64) TESTS 29 15 102400
203928499 Xellos B April 29, 2023, 3:12 p.m. OK GNU C++17 (64) TESTS 29 15 102400
203947107 gqf123 B April 29, 2023, 4:10 p.m. OK GNU C++17 (64) TESTS 29 15 204800
203991586 Sterling_07 B April 30, 2023, 1:35 a.m. OK GNU C++17 (64) TESTS 29 15 204800
203981270 enslaved B April 29, 2023, 9:20 p.m. OK GNU C++17 (64) TESTS 29 15 204800
203950060 mcclane57 B April 29, 2023, 4:21 p.m. OK GNU C++17 (64) TESTS 29 15 204800
203937714 JagguBandar B April 29, 2023, 3:38 p.m. OK GNU C++20 (64) TESTS 29 0 204800
203956328 DCH233 B April 29, 2023, 4:43 p.m. OK GNU C++20 (64) TESTS 29 0 409600
203962290 bashkort B April 29, 2023, 5:34 p.m. OK GNU C++20 (64) TESTS 29 0 614400
203988633 MvKaio B April 30, 2023, 12:18 a.m. OK GNU C++20 (64) TESTS 29 15 102400
203979875 Everule B April 29, 2023, 8:52 p.m. OK GNU C++20 (64) TESTS 29 15 102400
203966720 rgnerdplayer B April 29, 2023, 6:12 p.m. OK GNU C++20 (64) TESTS 29 15 102400
203963106 fcw B April 29, 2023, 5:40 p.m. OK GNU C++20 (64) TESTS 29 15 102400
204000935 lquo B April 30, 2023, 5:02 a.m. OK GNU C++20 (64) TESTS 29 15 102400
203995756 psoet B April 30, 2023, 3:15 a.m. OK GNU C++20 (64) TESTS 29 15 102400
203993331 Tobo B April 30, 2023, 2:19 a.m. OK GNU C++20 (64) TESTS 29 15 102400
203964021 profchi B April 29, 2023, 5:47 p.m. OK Java 11 TESTS 29 218 0
203939291 cirno3153 B April 29, 2023, 3:43 p.m. OK Java 11 TESTS 29 249 204800
203930254 SecondThread B April 29, 2023, 3:17 p.m. OK Java 8 TESTS 29 155 38604800
203925420 FastFreeTask B April 29, 2023, 3:05 p.m. OK Kotlin 1.6 TESTS 29 233 512000
203923211 Tlatoani B April 29, 2023, 3 p.m. OK Kotlin 1.7 TESTS 29 390 47104000
203927460 plevande B April 29, 2023, 3:10 p.m. OK PyPy 3 TESTS 29 155 6553600
203940356 hxu10 B April 29, 2023, 3:47 p.m. OK PyPy 3 TESTS 29 171 5222400
203929338 misorin B April 29, 2023, 3:15 p.m. OK PyPy 3 TESTS 29 187 4096000
203956325 conqueror_of_tourist B April 29, 2023, 4:43 p.m. OK PyPy 3-64 TESTS 29 124 9011200
203933277 toam B April 29, 2023, 3:25 p.m. OK PyPy 3-64 TESTS 29 155 7475200
203949297 petamingks B April 29, 2023, 4:19 p.m. OK PyPy 3-64 TESTS 29 171 26828800
203958278 Maruzensky B April 29, 2023, 4:49 p.m. OK PyPy 3-64 TESTS 29 186 10547200
203947395 BasicTH B April 29, 2023, 4:11 p.m. OK PyPy 3-64 TESTS 29 217 140288000
203937685 chinerist B April 29, 2023, 3:38 p.m. OK PyPy 3-64 TESTS 29 327 13004800
203990199 huikang B April 30, 2023, 1 a.m. OK PyPy 3-64 TESTS 29 498 12185600
203947151 codicon B April 29, 2023, 4:10 p.m. OK PyPy 3-64 TESTS 29 561 11468800
203925035 sansen B April 29, 2023, 3:04 p.m. OK Rust 2021 TESTS 29 15 307200
203923635 Spheniscine B April 29, 2023, 3 p.m. OK Rust 2021 TESTS 29 15 307200
203956507 Frommi B April 29, 2023, 4:44 p.m. OK Rust 2021 TESTS 29 15 4608000
203934301 WaterColor2037 B April 29, 2023, 3:28 p.m. OK Rust 2021 TESTS 29 31 409600

remove filters

Back to search problems