Codeforces Round 728 (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
1540 Codeforces Round 728 (Div. 1) FINISHED False 8100 107187899 June 25, 2021, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14012 ) A Great Graphs PROGRAMMING constructive algorithms graphs greedy shortest paths sortings

B"Farmer John has a farm that consists of n pastures connected by one-directional roads. Each road has a weight, representing the time it takes to go from the start to the end of the road. The roads could have negative weight, where the cows go so fast that they go back in time! However, Farmer John guarantees that it is impossible for the cows to get stuck in a time loop, where they can infinitely go back in time by traveling across a sequence of roads. Also, each pair of pastures is connected by at most one road in each direction. Unfortunately, Farmer John lost the map of the farm. All he remembers is an array d , where d_i is the smallest amount of time it took the cows to reach the i -th pasture from pasture 1 using a sequence of roads. The cost of his farm is the sum of the weights of each of the roads, and Farmer John needs to know the minimal cost of a farm that is consistent with his memory. The first line contains one integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Then t cases follow. The first line of each test case contains a single integer n ( 1 <= q n <= q 10^5 ) -- the number of pastures. The second line of each test case contains n space separated integers d_1, d_2, ldots, d_n ( 0 <= q d_i <= q 10^9 ) -- the array d . It is guaranteed that d_1 = 0 . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output the minimum possible cost of a farm that is consistent with Farmer John's memory. In the first test case, you can add roads In the second test case, you can add a road from pasture 1 to pasture 2 with cost 1000000000 and a road from pasture 2 to pasture 1 with cost -1000000000 . The total cost is 1000000000 + -1000000000 = 0 . In the third test case, you can't add any roads. The total cost is 0 . "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
120549588 Gassa A June 25, 2021, 3:47 p.m. OK D TESTS 11 46 4198400
120556716 jdsb A June 25, 2021, 3:55 p.m. OK GNU C++11 TESTS 11 15 409600
120625140 Encounter_qty A June 26, 2021, 12:11 a.m. OK GNU C++11 TESTS 13 15 819200
120540889 wenhao801 A June 25, 2021, 3:41 p.m. OK GNU C++11 TESTS 11 30 409600
120595676 sunzihao A June 25, 2021, 5:08 p.m. OK GNU C++11 TESTS 11 30 409600
120546270 xqbf A June 25, 2021, 3:44 p.m. OK GNU C++11 TESTS 11 30 1638400
120563514 myx12345 A June 25, 2021, 4:04 p.m. OK GNU C++11 TESTS 11 30 2662400
120626226 vectorwyx A June 26, 2021, 1:05 a.m. OK GNU C++11 TESTS 13 30 16076800
120636772 vectorwyx A June 26, 2021, 5:18 a.m. OK GNU C++11 TESTS 13 30 16076800
120627468 Lucky_Yukikaze A June 26, 2021, 1:55 a.m. OK GNU C++11 TESTS 13 31 204800
120555964 namelessgugugu A June 25, 2021, 3:54 p.m. OK GNU C++11 TESTS 11 31 204800
120537026 peehs_moorhsum A June 25, 2021, 3:38 p.m. OK GNU C++14 TESTS 11 31 409600
120554611 ComradePetr A June 25, 2021, 3:52 p.m. OK GNU C++14 TESTS 11 46 409600
120617279 Tech_shot A June 25, 2021, 7:38 p.m. OK GNU C++14 TESTS 11 46 409600
120556111 ArminAzimi A June 25, 2021, 3:54 p.m. OK GNU C++14 TESTS 11 46 409600
120554198 bqq A June 25, 2021, 3:52 p.m. OK GNU C++14 TESTS 11 46 409600
120552060 Naseem17 A June 25, 2021, 3:49 p.m. OK GNU C++14 TESTS 11 46 409600
120549117 _no0B A June 25, 2021, 3:47 p.m. OK GNU C++14 TESTS 11 46 409600
120548233 Redhood A June 25, 2021, 3:46 p.m. OK GNU C++14 TESTS 11 46 409600
120544872 Onjo A June 25, 2021, 3:43 p.m. OK GNU C++14 TESTS 11 46 409600
120542156 SongC A June 25, 2021, 3:42 p.m. OK GNU C++14 TESTS 11 46 409600
120541477 aa2985759 A June 25, 2021, 3:41 p.m. OK GNU C++17 TESTS 11 15 409600
120537117 Roundgod A June 25, 2021, 3:39 p.m. OK GNU C++17 TESTS 11 31 409600
120542218 Frank_DD A June 25, 2021, 3:42 p.m. OK GNU C++17 TESTS 11 31 409600
120544774 wudi2016 A June 25, 2021, 3:43 p.m. OK GNU C++17 TESTS 11 31 2048000
120540362 Sutaner A June 25, 2021, 3:41 p.m. OK GNU C++17 TESTS 11 31 3174400
120610857 couplefire A June 25, 2021, 6:16 p.m. OK GNU C++17 TESTS 11 46 409600
120560390 enochjung A June 25, 2021, 4 p.m. OK GNU C++17 TESTS 11 46 409600
120595359 31ballons A June 25, 2021, 5:07 p.m. OK GNU C++17 TESTS 11 46 409600
120627521 deafff A June 26, 2021, 1:57 a.m. OK GNU C++17 TESTS 13 46 409600
120618923 pedrohlf A June 25, 2021, 8:11 p.m. OK GNU C++17 TESTS 13 46 409600
120634226 Alphagocc A June 26, 2021, 4:36 a.m. OK GNU C++17 (64) TESTS 13 15 1331200
120546671 yosupo A June 25, 2021, 3:45 p.m. OK GNU C++17 (64) TESTS 11 15 1638400
120625923 Chocola4ever A June 26, 2021, 12:50 a.m. OK GNU C++17 (64) TESTS 13 15 2867200
120536907 NotaMotuaQAQ A June 25, 2021, 3:38 p.m. OK GNU C++17 (64) TESTS 11 15 5017600
120560806 DmitryLzr A June 25, 2021, 4 p.m. OK GNU C++17 (64) TESTS 11 30 409600
120611118 yash_daga A June 25, 2021, 6:18 p.m. OK GNU C++17 (64) TESTS 11 30 819200
120549209 darklight13 A June 25, 2021, 3:47 p.m. OK GNU C++17 (64) TESTS 11 30 819200
120548535 FlameDragon A June 25, 2021, 3:46 p.m. OK GNU C++17 (64) TESTS 11 30 819200
120616372 ljuba A June 25, 2021, 7:22 p.m. OK GNU C++17 (64) TESTS 11 30 819200
120561008 zerver52 A June 25, 2021, 4:01 p.m. OK GNU C++17 (64) TESTS 11 30 819200
120558178 Haskell_for_a_pint A June 25, 2021, 3:57 p.m. OK Haskell TESTS 11 171 6451200
120548921 nick_301 A June 25, 2021, 3:47 p.m. OK Java 11 TESTS 11 217 0
120545931 cirno3153 A June 25, 2021, 3:44 p.m. OK Java 11 TESTS 11 217 0
120555570 bobbilyking A June 25, 2021, 3:54 p.m. OK Java 11 TESTS 11 233 0
120634207 yogii_123 A June 26, 2021, 4:35 a.m. OK Java 11 TESTS 13 233 0
120539180 SecondThread A June 25, 2021, 3:40 p.m. OK Java 11 TESTS 11 249 0
120560491 saptarshi1729 A June 25, 2021, 4 p.m. OK Java 11 TESTS 11 249 19046400
120561743 martins A June 25, 2021, 4:02 p.m. OK Java 11 TESTS 11 264 0
120542009 Discombobulated A June 25, 2021, 3:42 p.m. OK Java 11 TESTS 11 264 614400
120638966 Yash_s3135 A June 26, 2021, 5:51 a.m. OK Java 11 TESTS 13 343 0
120548583 SurpriseMe A June 25, 2021, 3:46 p.m. OK Java 8 TESTS 11 124 9728000
120573041 DarLam A June 25, 2021, 4:19 p.m. OK Java 8 TESTS 11 139 0
120547930 ElragolEl3enab A June 25, 2021, 3:46 p.m. OK Java 8 TESTS 11 140 0
120611021 hu_tao A June 25, 2021, 6:17 p.m. OK Java 8 TESTS 11 156 0
120540336 dalt A June 25, 2021, 3:40 p.m. OK Java 8 TESTS 11 171 0
120561588 pulkit1411 A June 25, 2021, 4:01 p.m. OK Java 8 TESTS 11 171 30822400
120623326 FlameFire A June 25, 2021, 10:28 p.m. OK Java 8 TESTS 13 186 0
120540724 2020akadaver A June 25, 2021, 3:41 p.m. OK Java 8 TESTS 11 187 0
120637469 Dcoder123 A June 26, 2021, 5:29 a.m. OK Java 8 TESTS 13 218 0
120615273 bookguy A June 25, 2021, 7:04 p.m. OK Java 8 TESTS 11 405 2355200
120545749 Hakiobo A June 25, 2021, 3:44 p.m. OK Kotlin TESTS 11 186 1331200
120552722 LeoPro A June 25, 2021, 3:50 p.m. OK Kotlin TESTS 11 249 9011200
120636619 Potassium A June 26, 2021, 5:15 a.m. OK Kotlin TESTS 13 280 5939200
120566265 koper A June 25, 2021, 4:08 p.m. OK Kotlin TESTS 11 280 6246400
120611387 Tlatoani A June 25, 2021, 6:20 p.m. OK Kotlin TESTS 11 280 9011200
120546298 Friska A June 25, 2021, 3:44 p.m. OK MS C++ 2017 TESTS 11 109 819200
120559520 grey A June 25, 2021, 3:59 p.m. OK MS C++ 2017 TESTS 11 109 1638400
120545776 Catmoonlight A June 25, 2021, 3:44 p.m. OK MS C++ 2017 TESTS 11 124 819200
120579963 not_antony A June 25, 2021, 4:32 p.m. OK MS C++ 2017 TESTS 11 124 1228800
120547408 mban259 A June 25, 2021, 3:45 p.m. OK .NET Core C# TESTS 11 108 8294400
120541979 azukun A June 25, 2021, 3:42 p.m. OK .NET Core C# TESTS 11 108 8396800
120562078 Yupiteru A June 25, 2021, 4:02 p.m. OK .NET Core C# TESTS 11 139 3788800
120549622 bcollet A June 25, 2021, 3:47 p.m. OK PyPy 2 TESTS 11 124 7987200
120547331 dukati8 A June 25, 2021, 3:45 p.m. OK PyPy 2 TESTS 11 795 9113600
120546185 Arpa A June 25, 2021, 3:44 p.m. OK PyPy 3 TESTS 11 124 9420800
120542998 codicon A June 25, 2021, 3:42 p.m. OK PyPy 3 TESTS 11 139 9216000
120550671 nagiss A June 25, 2021, 3:48 p.m. OK PyPy 3 TESTS 11 140 9625600
120548058 tehlka A June 25, 2021, 3:46 p.m. OK PyPy 3 TESTS 11 171 10444800
120563818 kisszots A June 25, 2021, 4:05 p.m. OK PyPy 3 TESTS 11 202 10342400
120545447 hir35 A June 25, 2021, 3:44 p.m. OK PyPy 3 TESTS 11 202 10342400
120548980 titia A June 25, 2021, 3:47 p.m. OK PyPy 3 TESTS 11 202 10547200
120546147 SPD_9X2 A June 25, 2021, 3:44 p.m. OK PyPy 3 TESTS 11 202 10547200
120537297 asdsasd A June 25, 2021, 3:39 p.m. OK PyPy 3 TESTS 11 217 10547200
120554201 eepsilon A June 25, 2021, 3:52 p.m. OK PyPy 3 TESTS 11 218 10649600
120542323 nwi A June 25, 2021, 3:42 p.m. OK Python 2 TESTS 11 171 5734400
120558466 r57shell A June 25, 2021, 3:57 p.m. OK Python 3 TESTS 11 171 7884800
120626898 minglu A June 26, 2021, 1:32 a.m. OK Python 3 TESTS 13 171 8192000
120559566 belkka A June 25, 2021, 3:59 p.m. OK Python 3 TESTS 11 171 8192000
120633876 jkjk22 A June 26, 2021, 4:30 a.m. OK Python 3 TESTS 13 202 8192000
120550599 misorin A June 25, 2021, 3:48 p.m. OK Python 3 TESTS 11 218 8192000
120543452 sansen A June 25, 2021, 3:42 p.m. OK Rust TESTS 11 31 2252800
120546628 nebocco A June 25, 2021, 3:45 p.m. OK Rust TESTS 11 46 2150400
120556470 toomer A June 25, 2021, 3:55 p.m. OK Rust TESTS 11 61 5836800
120538759 qwerty787788 A June 25, 2021, 3:40 p.m. OK Rust TESTS 11 61 6348800
120552851 cottoncotton A June 25, 2021, 3:50 p.m. OK Rust TESTS 11 93 1228800

remove filters

Back to search problems