Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round)

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
2021 Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) FINISHED False 7200 48210923 Oct. 6, 2024, 6:05 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1918 ) E1 Digital Village (Easy Version) PROGRAMMING brute force data structures dp dsu graphs greedy implementation math shortest paths trees

This is the easy version of the problem. In the three versions, the constraints on (n) and (m) are different. You can make hacks only if all the versions of the problem are solved. Pak Chanek is setting up internet connections for the village of Khuntien. The village can be represented as a connected simple graph with (n) houses and (m) internet cables connecting house (u_i) and house (v_i), each with a latency of (w_i). There are (p) houses that require internet. Pak Chanek can install servers in at most (k) of the houses. The houses that need internet will then be connected to one of the servers. However, since each cable has its latency, the latency experienced by house (s_i) requiring internet will be the maximum latency of the cables between that house and the server it is connected to. For each (k = 1,2,\ldots,n), help Pak Chanek determine the minimum total latency that can be achieved for all the houses requiring internet. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains three integers (n), (m), (p) ((2 \le n \le 400); (n-1 \le m \le 400); (1 \le p \le n)) — the number of houses, the number of cables and the number of houses that need internet. The second line of each test case contains (p) integers (s_1, s_2, \ldots, s_p) ((1 \le s_i \le n)) — the houses that need internet. It is guaranteed that all elements of (s) are distinct. The (i)-th of the next (m) lines of each test case contains three integers (u_i), (v_i), and (w_i) ((1 \le u_i < v_i \le n); (1 \le w_i \le 10^9)) — the internet cable connecting house (u_i) and house (v_i) with latency of (w_i). It is guaranteed that the given edges form a connected simple graph. It is guaranteed that the sum of (n^3) and the

Tutorials

Codeforces Round #977 (Div. 2, based on COMPFEST 16 — Final Round) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
284722363 og.kostya E1 Oct. 7, 2024, 5:05 a.m. OK C# 10 TESTS 24 155 921600
284720034 dmraykhan E1 Oct. 7, 2024, 4:35 a.m. OK C++17 (GCC 7-32) TESTS 24 46 102400
284713551 2021chenyiqingqing E1 Oct. 7, 2024, 2:44 a.m. OK C++17 (GCC 7-32) TESTS 24 46 5324800
284709648 Guitar_Jasmine E1 Oct. 7, 2024, 1:18 a.m. OK C++17 (GCC 7-32) TESTS 24 61 102400
284700417 vkgainz E1 Oct. 6, 2024, 8:58 p.m. OK C++17 (GCC 7-32) TESTS 24 61 102400
284660671 sunrise1024 E1 Oct. 6, 2024, 2:44 p.m. OK C++17 (GCC 7-32) TESTS 24 61 512000
284716100 PeruvianCartel E1 Oct. 7, 2024, 3:32 a.m. OK C++17 (GCC 7-32) TESTS 24 61 3993600
284620987 Chenly E1 Oct. 6, 2024, 10:28 a.m. OK C++17 (GCC 7-32) TESTS 24 61 12902400
284652815 yuanhaowei E1 Oct. 6, 2024, 1:51 p.m. OK C++17 (GCC 7-32) TESTS 24 61 13721600
284650679 polariscyy E1 Oct. 6, 2024, 1:37 p.m. OK C++17 (GCC 7-32) TESTS 24 61 16076800
284711601 lizeyu2008 E1 Oct. 7, 2024, 2:08 a.m. OK C++17 (GCC 7-32) TESTS 24 61 27750400
284666044 diobrando97 E1 Oct. 6, 2024, 3:23 p.m. OK C++20 (GCC 13-64) TESTS 24 46 102400
284713479 Bswoalwo E1 Oct. 7, 2024, 2:43 a.m. OK C++20 (GCC 13-64) TESTS 24 46 204800
284726036 sillk E1 Oct. 7, 2024, 5:45 a.m. OK C++20 (GCC 13-64) TESTS 24 46 201318400
284642959 ntKhai384 E1 Oct. 6, 2024, 12:46 p.m. OK C++20 (GCC 13-64) TESTS 24 61 0
284712204 brute_forceCE E1 Oct. 7, 2024, 2:19 a.m. OK C++20 (GCC 13-64) TESTS 24 61 102400
284659054 gabriel88766 E1 Oct. 6, 2024, 2:32 p.m. OK C++20 (GCC 13-64) TESTS 24 61 1433600
284611052 invertedwinger E1 Oct. 6, 2024, 9:29 a.m. OK C++20 (GCC 13-64) TESTS 24 61 2150400
284715331 fydj E1 Oct. 7, 2024, 3:18 a.m. OK C++20 (GCC 13-64) TESTS 24 61 23347200
284644406 Bahamin E1 Oct. 6, 2024, 12:56 p.m. OK C++20 (GCC 13-64) TESTS 24 61 201011200
284718766 zacharychao E1 Oct. 7, 2024, 4:17 a.m. OK C++20 (GCC 13-64) TESTS 24 62 102400
284607816 _MASSIMO_ E1 Oct. 6, 2024, 9:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 61 102400
284714631 lyh3.14 E1 Oct. 7, 2024, 3:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 61 8294400
284652936 Zimse. E1 Oct. 6, 2024, 1:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 61 16486400
284696831 gche E1 Oct. 6, 2024, 8:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 102400
284636868 shiqiaqiaya E1 Oct. 6, 2024, 12:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 102400
284625357 zqx E1 Oct. 6, 2024, 10:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 307200
284652184 Dominater069 E1 Oct. 6, 2024, 1:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 1536000
284617988 scanner E1 Oct. 6, 2024, 10:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 1536000
284607039 satyam343 E1 Oct. 6, 2024, 9:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 4198400
284687158 244mhq E1 Oct. 6, 2024, 6:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 24 62 9728000
284608819 Yoda1122 E1 Oct. 6, 2024, 9:15 a.m. OK Java 21 TESTS 24 640 921600
284634611 IOI1947 E1 Oct. 6, 2024, 11:52 a.m. OK Java 8 TESTS 24 186 13414400
284672097 yvbf E1 Oct. 6, 2024, 4:12 p.m. OK Java 8 TESTS 24 202 0
284684611 nomadicjuggrnaut E1 Oct. 6, 2024, 6 p.m. OK Java 8 TESTS 24 1186 0
284654691 bnmanubharadwaj E1 Oct. 6, 2024, 2:03 p.m. OK Node.js TESTS 24 702 41267200
284666071 shifat25 E1 Oct. 6, 2024, 3:23 p.m. OK PyPy 3-64 TESTS 24 515 9113600
284672303 andycoke E1 Oct. 6, 2024, 4:14 p.m. OK PyPy 3-64 TESTS 24 796 9830400
284666766 shifat25 E1 Oct. 6, 2024, 3:29 p.m. OK PyPy 3-64 TESTS 24 952 9420800
284666698 _Shifat_ E1 Oct. 6, 2024, 3:29 p.m. OK PyPy 3-64 TESTS 24 952 9420800
284629909 gardengnome E1 Oct. 6, 2024, 11:24 a.m. OK PyPy 3-64 TESTS 24 968 8806400
284705082 Synaptic_Savant E1 Oct. 6, 2024, 10:37 p.m. OK PyPy 3-64 TESTS 24 1217 12185600
284705049 Synaptic_Savant E1 Oct. 6, 2024, 10:36 p.m. OK PyPy 3-64 TESTS 24 1264 12083200
284656076 V.chandini_sri E1 Oct. 6, 2024, 2:13 p.m. OK PyPy 3-64 TESTS 24 1546 9728000
284632733 Synaptic_Savant E1 Oct. 6, 2024, 11:41 a.m. OK PyPy 3-64 TESTS 24 1843 9011200
284633335 Synaptic_Savant E1 Oct. 6, 2024, 11:45 a.m. OK PyPy 3-64 TESTS 24 1858 8806400
284667296 PaciukZvichainyi E1 Oct. 6, 2024, 3:33 p.m. OK Rust 2021 TESTS 24 561 102400

remove filters

Back to search problems