Kotlin Heroes: Episode 7

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
1533 Kotlin Heroes: Episode 7 FINISHED False 9000 106845899 June 29, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 52 ) I Excursions PROGRAMMING *special constructive algorithms dfs and similar flows graphs

B"Irina works in an excursion company in Saratov. Today, she is going to organize excursions in the cities of Saratov and Engels. There are n_1 sights in Saratov and n_2 sights in Engels. The cities are separated by a river, but there are m bus routes that go along the bridges and allow tourists to go from Saratov to Engels and vice versa. The i -th bus route goes from the x_i -th sight in Saratov to the y_i -th sight in Engels, and in the opposite direction as well. Irina wants to plan excursions for the current day. The excursion trips start in Saratov in the morning, continue in Engels in the afternoon, and finish in Saratov in the evening. Each tourist starts their excursion day at some sight in Saratov, k_i tourists start at the i -th sight. Then the tour guides lead them to Engels: at each sight in Saratov, a tour guide chooses a bus route leading from this sight to Engels, and all the tourists starting from this sight transfer to Engels along this bus route. After the excursions in Engels are finished, the same thing happens: at each sight in Engels, a tour guide chooses a bus route leading from this sight to Saratov, and all the tourists at this sight transfer to Saratov along this bus route. This process can lead to a situation such that some tourists return to the same sight in Saratov where they started in the morning. Obviously, tourists don't like it; so Irina wants to choose where the tour guides take the tourists (both on the way from Saratov to Engels and on the way from Engels to Saratov), so that the minimum possible number of tourists return to the same sight where they started. Help Irina to find an optimal plan! The first line contains three integers n_1 , n_2 and m ( 1 <= n_1, n_2 <= 100 ; max(n_1, n_2) <= m <= n_1 cdot n_2 ) -- the number of sights in Saratov, the number of sights in Engels, and the number of bus routes, respectively. The second line contains "...

Tutorials

Kotlin Heroes 7 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
120920560 b2jena I June 30, 2021, 4:13 a.m. OK Kotlin TESTS 112 124 0
120895768 eatmore I June 29, 2021, 4:35 p.m. OK Kotlin TESTS 112 124 0
120890180 Petr I June 29, 2021, 3:33 p.m. OK Kotlin TESTS 112 124 0
120918383 Spheniscine I June 30, 2021, 3:12 a.m. OK Kotlin TESTS 112 140 0
120896747 Ra16bit I June 29, 2021, 4:47 p.m. OK Kotlin TESTS 112 140 204800
120905467 clyring I June 29, 2021, 7:03 p.m. OK Kotlin TESTS 112 140 614400
120907180 Algo.1067 I June 29, 2021, 7:41 p.m. OK Kotlin TESTS 112 155 614400
120895066 PurpleCrayon I June 29, 2021, 4:26 p.m. OK Kotlin TESTS 112 155 1331200
120892758 Maksim1744 I June 29, 2021, 4:01 p.m. OK Kotlin TESTS 112 170 716800
120891651 tourist I June 29, 2021, 3:49 p.m. OK Kotlin TESTS 112 171 512000

remove filters

Back to search problems