Codeforces Global Round 18

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
1615 Codeforces Global Round 18 FINISHED False 9000 96909863 Dec. 24, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 338 ) H Reindeer Games PROGRAMMING constructive algorithms flows graphs shortest paths

B'There are n reindeer at the North Pole, all battling for the highest spot on the "Top Reindeer" leaderboard on the front page of CodeNorses (a popular competitive reindeer gaming website). Interestingly, the "Top Reindeer" title is just a measure of upvotes and has nothing to do with their skill level in the reindeer games, but they still give it the utmost importance. Currently, the i -th reindeer has a score of a_i . You would like to influence the leaderboard with some operations. In an operation, you can choose a reindeer, and either increase or decrease his score by 1 unit. Negative scores are allowed. You have m requirements for the resulting scores. Each requirement is given by an ordered pair (u, v) , meaning that after all operations, the score of reindeer u must be less than or equal to the score of reindeer v . Your task is to perform the minimum number of operations so that all requirements will be satisfied. The first line contains two integers n and m ( 2 <= n <= 1000 ; 1 <= m <= 1000 ) -- the number of reindeer and requirements, respectively. The second line contains n integers a_1, ldots, a_n ( 1 <= a_i <= 10^9 ), where a_i is the current score of reindeer i . The next m lines describe the requirements. The i -th of these lines contains two integers u_i and v_i ( 1 <= u_i, v_i <= n ; u_i ne v_i ) -- the two reindeer of the i -th requirement. Print n integers b_1, ldots, b_n ( -10^{15} <= b_i <= 10^{15} ), where b_i is the score of the i -th reindeer after all operations. If there are multiple solutions achieving the minimum number of operations, you may output any. We can prove that there is always an optimal solution such that |b_i| <= 10^{15} for all i . '...

Tutorials

Global Round 18 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
140526815 rainboy H Dec. 24, 2021, 10:02 p.m. OK GNU C11 TESTS 64 109 307200
140503131 ugly2333 H Dec. 24, 2021, 4:54 p.m. OK GNU C++14 TESTS 64 78 1638400
140505593 xwp H Dec. 24, 2021, 5:02 p.m. OK GNU C++14 TESTS 64 265 92160000
140505753 Werner_Yin H Dec. 24, 2021, 5:03 p.m. OK GNU C++14 TESTS 64 296 49356800
140531683 Werner_Yin H Dec. 25, 2021, 1:38 a.m. OK GNU C++14 TESTS 64 296 49356800
140496760 Radewoosh H Dec. 24, 2021, 4:30 p.m. OK GNU C++14 TESTS 64 420 7270400
140508700 zhuzhirui2005 H Dec. 24, 2021, 5:31 p.m. OK GNU C++14 TESTS 64 670 614400
140499834 inaFSTream H Dec. 24, 2021, 4:42 p.m. OK GNU C++17 TESTS 64 124 16384000
140503467 suyiheng H Dec. 24, 2021, 4:55 p.m. OK GNU C++17 TESTS 64 140 10137600
140512240 Benq H Dec. 24, 2021, 6:05 p.m. OK GNU C++17 TESTS 64 155 921600
140512388 Benq H Dec. 24, 2021, 6:06 p.m. OK GNU C++17 TESTS 64 156 921600
140499201 Alan233 H Dec. 24, 2021, 4:39 p.m. OK GNU C++17 TESTS 64 171 24678400
140508245 Benq H Dec. 24, 2021, 5:27 p.m. OK GNU C++17 TESTS 64 202 1433600
140532792 juju054 H Dec. 25, 2021, 2:11 a.m. OK GNU C++17 TESTS 64 234 307200
140505242 sys. H Dec. 24, 2021, 5:01 p.m. OK GNU C++17 TESTS 64 265 921600
140507736 chemthan H Dec. 24, 2021, 5:24 p.m. OK GNU C++17 TESTS 64 265 29593600
140519904 dreamoon_love_AA H Dec. 24, 2021, 7:34 p.m. OK GNU C++17 TESTS 64 265 63180800
140503103 hitonanode H Dec. 24, 2021, 4:54 p.m. OK GNU C++17 (64) TESTS 64 15 819200
140525269 neal H Dec. 24, 2021, 9:17 p.m. OK GNU C++17 (64) TESTS 64 46 409600
140519976 neal H Dec. 24, 2021, 7:35 p.m. OK GNU C++17 (64) TESTS 64 62 409600
140525264 neal H Dec. 24, 2021, 9:17 p.m. OK GNU C++17 (64) TESTS 64 62 409600
140516596 neal H Dec. 24, 2021, 6:51 p.m. OK GNU C++17 (64) TESTS 64 62 409600
140529235 krijgertje H Dec. 24, 2021, 11:51 p.m. OK GNU C++17 (64) TESTS 64 78 1331200
140504019 QAQAutoMaton H Dec. 24, 2021, 4:57 p.m. OK GNU C++17 (64) TESTS 64 78 92672000
140504987 PinkieRabbit H Dec. 24, 2021, 5 p.m. OK GNU C++17 (64) TESTS 64 93 204800
140525904 neal H Dec. 24, 2021, 9:35 p.m. OK GNU C++17 (64) TESTS 64 93 1843200
140493509 Froggay H Dec. 24, 2021, 4:19 p.m. OK GNU C++17 (64) TESTS 64 109 2048000
140508599 mtsd H Dec. 24, 2021, 5:30 p.m. OK GNU C++20 (64) TESTS 64 46 307200
140536985 ButterCake H Dec. 25, 2021, 4:04 a.m. OK GNU C++20 (64) TESTS 65 93 204800
140512971 jiangly H Dec. 24, 2021, 6:12 p.m. OK GNU C++20 (64) TESTS 64 93 1843200
140499473 risujiroh H Dec. 24, 2021, 4:40 p.m. OK GNU C++20 (64) TESTS 64 93 2662400
140491138 Y25t H Dec. 24, 2021, 4:11 p.m. OK GNU C++20 (64) TESTS 64 109 1228800
140526412 heno239 H Dec. 24, 2021, 9:50 p.m. OK GNU C++20 (64) TESTS 64 218 9216000
140503372 CXY007 H Dec. 24, 2021, 4:54 p.m. OK GNU C++20 (64) TESTS 64 218 218316800
140532752 zlt1117 H Dec. 25, 2021, 2:10 a.m. OK GNU C++20 (64) TESTS 64 233 65638400
140532823 juju054 H Dec. 25, 2021, 2:12 a.m. OK GNU C++20 (64) TESTS 64 249 204800
140512725 hos.lyric H Dec. 24, 2021, 6:09 p.m. OK GNU C++20 (64) TESTS 64 249 26726400
140501351 eatmore H Dec. 24, 2021, 4:47 p.m. OK Java 11 TESTS 64 265 0

remove filters

Back to search problems