Educational Codeforces Round 105 (Rated for Div. 2)

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
1494 Educational Codeforces Round 105 (Rated for Div. 2) FINISHED False 7200 122570063 March 2, 2021, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 391 ) F Delete The Edges PROGRAMMING graphs

B"You are given an undirected connected graph consisting of n vertices and m edges. Your goal is to destroy all edges of the given graph. You may choose any vertex as the starting one and begin walking from it along the edges. When you walk along an edge, you destroy it. Obviously, you cannot walk along an edge if it is destroyed. You can perform the mode shift operation at most once during your walk, and this operation can only be performed when you are at some vertex (you cannot perform it while traversing an edge). After the mode shift, the edges you go through are deleted in the following way: the first edge after the mode shift is not destroyed, the second one is destroyed, the third one is not destroyed, the fourth one is destroyed, and so on. You cannot switch back to the original mode, and you don't have to perform this operation if you don't want to. Can you destroy all the edges of the given graph? The first line contains two integers n and m ( 2 <= n <= 3000 ; n - 1 <= m <= min( frac{n(n-1)}{2}, 3000 )) -- the numbef of vertices and the number of edges in the graph. Then m lines follow, each containing two integers x_i and y_i ( 1 <= x_i, y_i <= n ; x_i ne y_i ) -- the endpoints of the i -th edge. These edges form a connected undirected graph without multiple edges. If it's impossible to destroy all of the edges, print 0. Otherwise, print the sequence of your actions as follows. First, print k -- the number of actions ( k <= 2m + 2 ). Then, print the sequence itself, consisting of k integers. The first integer should be the index of the starting vertex. Then, each of the next integers should be either the index of the next vertex in your traversal, or -1 if you use mode shift. You are allowed to use mode shift at most once. If there are multiple answers, print any of them. "...

Tutorials

Educational Codeforces Round 105 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
108939159 Pyqe F March 2, 2021, 4:34 p.m. OK GNU C++11 TESTS 37 62 614400

remove filters

Back to search problems