Codeforces Round 598 (Div. 3)

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
1256 Codeforces Round 598 (Div. 3) FINISHED False 7200 158949899 Nov. 4, 2019, 1:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4172 ) E Yet Another Division Into Teams PROGRAMMING dp greedy sortings 2200

B"There are n students at your university. The programming skill of the i -th student is a_i . As a coach, you want to divide them into teams to prepare them for the upcoming ICPC finals. Just imagine how good this university is if it has 2 cdot 10^5 students ready for the finals! Each team should consist of at least three students. Each student should belong to exactly one team. The diversity of a team is the difference between the maximum programming skill of some student that belongs to this team and the minimum programming skill of some student that belongs to this team (in other words, if the team consists of k students with programming skills a[i_1], a[i_2], ... , a[i_k] , then the diversity of this team is max limits_{j=1}^{k} a[i_j] - min limits_{j=1}^{k} a[i_j] ). The total diversity is the sum of diversities of all teams formed. Your task is to minimize the total diversity of the division of students and find the optimal way to divide the students. The first line of the input contains one integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of students. The second line of the input contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ), where a_i is the programming skill of the i -th student. In the first line print two integers res and k -- the minimum total diversity of the division of students and the number of teams in your division, correspondingly. In the second line print n integers t_1, t_2, ... , t_n ( 1 <= t_i <= k ), where t_i is the number of team to which the i -th student belong. If there are multiple answers, you can print any. Note that you don't need to minimize the number of teams. Each team should consist of at least three students. In the first example, there is only one team with skills [1, 1, 2, 3, 4] so the answer is 3 . It can be shown that you cannot achieve a better answer. In the s"...

Tutorials

Codeforces Round #598 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
64539157 dyzsr E Nov. 8, 2019, 6 p.m. OK Clang++17 Diagnostics TESTS 52 1450 11468800 2200
64544309 jschr E Nov. 8, 2019, 7:47 p.m. OK GNU C11 TESTS 52 733 7270400 2200
64511011 chenyewei_1234 E Nov. 8, 2019, 8:49 a.m. OK GNU C++11 TESTS 52 62 6451200 2200
64563917 WhiteCmile E Nov. 9, 2019, 7:01 a.m. OK GNU C++11 TESTS 52 77 4812800 2200
68002240 Alan_zhou E Dec. 31, 2019, 11:27 a.m. OK GNU C++11 TESTS 52 77 5632000 2200
64435401 AyoAyowei E Nov. 7, 2019, 12:55 a.m. OK GNU C++11 TESTS 52 77 15974400 2200
64731733 X_o_r E Nov. 12, 2019, 8:42 a.m. OK GNU C++11 TESTS 52 78 4608000 2200
69276795 cornivores E Jan. 22, 2020, 2:53 a.m. OK GNU C++11 TESTS 52 78 5632000 2200
64667284 zhenGG E Nov. 11, 2019, 3:27 a.m. OK GNU C++11 TESTS 52 78 7270400 2200
64339978 lx_zjk E Nov. 6, 2019, 1:47 a.m. OK GNU C++11 TESTS 52 78 7987200 2200
64888831 M_sea E Nov. 14, 2019, 2:01 p.m. OK GNU C++11 TESTS 52 93 3993600 2200
64564614 NaVi_Gation E Nov. 9, 2019, 7:15 a.m. OK GNU C++11 TESTS 52 93 4812800 2200
65509004 Lezedary_sandwich E Nov. 22, 2019, 2:03 a.m. OK GNU C++14 TESTS 52 78 4096000 2200
64344010 Willem E Nov. 6, 2019, 5:02 a.m. OK GNU C++14 TESTS 52 108 5632000 2200
68682742 ..vince E Jan. 13, 2020, 12:35 a.m. OK GNU C++14 TESTS 52 109 3174400 2200
65560620 zycmx E Nov. 23, 2019, 2:39 a.m. OK GNU C++14 TESTS 52 109 3993600 2200
65540122 Berted E Nov. 22, 2019, 3:28 p.m. OK GNU C++14 TESTS 52 109 3993600 2200
65519154 KVL E Nov. 22, 2019, 7:27 a.m. OK GNU C++14 TESTS 52 109 3993600 2200
66277013 rohan_vora E Dec. 4, 2019, 3:06 p.m. OK GNU C++14 TESTS 52 109 3993600 2200
65272631 Adel_Rizq E Nov. 17, 2019, 8:54 p.m. OK GNU C++14 TESTS 52 109 3993600 2200
65156343 RandyDKC E Nov. 16, 2019, 9:28 a.m. OK GNU C++14 TESTS 52 109 3993600 2200
65513673 iwanna E Nov. 22, 2019, 5:42 a.m. OK GNU C++14 TESTS 52 109 3993600 2200
65029535 nickluo E Nov. 15, 2019, 9:16 a.m. OK GNU C++17 TESTS 52 78 5324800 2200
65326434 interestingLSY E Nov. 19, 2019, 1:52 a.m. OK GNU C++17 TESTS 52 93 12902400 2200
65326450 HatsuneMikuo E Nov. 19, 2019, 1:53 a.m. OK GNU C++17 TESTS 52 93 12902400 2200
64342504 guagua123 E Nov. 6, 2019, 3:54 a.m. OK GNU C++17 TESTS 52 108 3993600 2200
65319778 GRT_2018 E Nov. 18, 2019, 7:04 p.m. OK GNU C++17 TESTS 52 109 3174400 2200
64467359 Guaguapi E Nov. 7, 2019, 12:06 p.m. OK GNU C++17 TESTS 52 109 3993600 2200
64790111 2018327130054 E Nov. 13, 2019, 10:50 a.m. OK GNU C++17 TESTS 52 109 3993600 2200
66298562 Dr.odd E Dec. 5, 2019, 5:56 a.m. OK GNU C++17 TESTS 52 109 3993600 2200
64910436 misir E Nov. 15, 2019, 2:46 a.m. OK GNU C++17 TESTS 52 109 3993600 2200
64713872 Resul E Nov. 11, 2019, 8:21 p.m. OK GNU C++17 TESTS 52 109 3993600 2200
65506838 stefan.sakalik E Nov. 21, 2019, 11:38 p.m. OK Go TESTS 52 342 30515200 2200
64317190 z20124528 E Nov. 5, 2019, 2:27 p.m. OK Go TESTS 52 982 8908800 2200
65456005 IslamTalipovTop E Nov. 20, 2019, 8:36 p.m. OK Java 11 TESTS 52 358 6758400 2200
69004311 rohithsajith E Jan. 17, 2020, 9:40 p.m. OK Java 11 TESTS 52 373 5632000 2200
66656164 TheSawan E Dec. 11, 2019, 11:03 p.m. OK Java 11 TESTS 52 405 10956800 2200
64371227 potatmen E Nov. 6, 2019, 2:23 p.m. OK Java 11 TESTS 52 436 10956800 2200
64342735 lpls1 E Nov. 6, 2019, 4:04 a.m. OK Java 11 TESTS 52 982 5632000 2200
64496973 bluesky111 E Nov. 8, 2019, 12:49 a.m. OK Java 8 TESTS 52 264 4812800 2200
64358454 Khater E Nov. 6, 2019, 11:02 a.m. OK Java 8 TESTS 52 264 9932800 2200
64630848 jakejase2 E Nov. 10, 2019, 10:07 a.m. OK Java 8 TESTS 52 265 4198400 2200
64329494 Oopsimbad E Nov. 5, 2019, 6:41 p.m. OK Java 8 TESTS 52 280 10137600 2200
64317289 luchy0120 E Nov. 5, 2019, 2:29 p.m. OK Java 8 TESTS 52 295 3481600 2200
65558250 Java E Nov. 23, 2019, 12:43 a.m. OK Java 8 TESTS 52 295 12083200 2200
64713513 xodiac E Nov. 11, 2019, 8:07 p.m. OK Java 8 TESTS 52 295 16076800 2200
65327634 martins E Nov. 19, 2019, 3:08 a.m. OK Java 8 TESTS 52 296 6860800 2200
64342093 yaoct E Nov. 6, 2019, 3:33 a.m. OK Java 8 TESTS 52 296 14438400 2200
66541349 mennafadali E Dec. 9, 2019, 11:38 a.m. OK Java 8 TESTS 52 311 30515200 2200
64582834 Ash3008Kr E Nov. 9, 2019, 12:34 p.m. OK Kotlin TESTS 52 1325 18944000 2200
65499677 tycyd E Nov. 21, 2019, 6:12 p.m. OK Mono C# TESTS 52 1575 37888000 2200
69478153 tarattata1 E Jan. 24, 2020, 4:50 p.m. OK MS C++ TESTS 52 109 10444800 2200
69885225 vjudge5 E Jan. 31, 2020, 7:57 a.m. OK MS C++ TESTS 52 124 3993600 2200
64676566 vjudge2 E Nov. 11, 2019, 8:16 a.m. OK MS C++ TESTS 52 124 4812800 2200
66488632 YoshinariYoh E Dec. 8, 2019, 7:36 a.m. OK MS C++ 2017 TESTS 52 140 3993600 2200
64735046 shebao E Nov. 12, 2019, 9:59 a.m. OK MS C++ 2017 TESTS 52 140 40038400 2200
64559107 keleven E Nov. 9, 2019, 5:19 a.m. OK MS C++ 2017 TESTS 52 171 3993600 2200
65569367 VagrantAC E Nov. 23, 2019, 7:16 a.m. OK MS C++ 2017 TESTS 52 234 6451200 2200
66236384 tik-tok E Dec. 3, 2019, 4:20 p.m. OK MS C++ 2017 TESTS 52 343 7270400 2200
65456923 shino E Nov. 20, 2019, 9:15 p.m. OK MS C++ 2017 TESTS 52 358 3993600 2200
64472767 D835s E Nov. 7, 2019, 1:32 p.m. OK MS C++ 2017 TESTS 52 358 4812800 2200
66724286 wuxigk E Dec. 12, 2019, 3:45 p.m. OK MS C++ 2017 TESTS 52 358 5836800 2200
65105135 TsatskiPetski E Nov. 15, 2019, 6:57 p.m. OK MS C++ 2017 TESTS 52 358 9011200 2200
64519130 rokirovochka E Nov. 8, 2019, 11:46 a.m. OK MS C++ 2017 TESTS 52 358 9113600 2200
66053521 shehebe E Nov. 30, 2019, 6:29 p.m. OK PyPy 2 TESTS 52 873 21811200 2200
64359364 kabeer27 E Nov. 6, 2019, 11:17 a.m. OK PyPy 2 TESTS 52 889 22630400 2200
65297030 yumtam E Nov. 18, 2019, 11:54 a.m. OK PyPy 2 TESTS 52 904 22118400 2200
65278112 zdbtxdy E Nov. 18, 2019, 3:23 a.m. OK PyPy 2 TESTS 52 904 43622400 2200
64657501 Riolku E Nov. 10, 2019, 7:43 p.m. OK PyPy 3 TESTS 52 655 45363200 2200
68845326 algdgn E Jan. 15, 2020, 7:13 a.m. OK PyPy 3 TESTS 52 701 27648000 2200
69290420 mitribunskiy E Jan. 22, 2020, 10 a.m. OK PyPy 3 TESTS 52 795 41369600 2200
64353524 haineko28 E Nov. 6, 2019, 9:19 a.m. OK PyPy 3 TESTS 52 810 28672000 2200
65111172 Leendertz E Nov. 15, 2019, 10:40 p.m. OK PyPy 3 TESTS 52 919 29081600 2200
68063680 baluteshih E Jan. 2, 2020, 6:18 a.m. OK PyPy 3 TESTS 52 1029 24883200 2200
66671417 sruthi_1729 E Dec. 12, 2019, 9:29 a.m. OK PyPy 3 TESTS 52 1044 24166400 2200
64532863 auouo E Nov. 8, 2019, 4 p.m. OK PyPy 3 TESTS 52 1044 24371200 2200
64598471 yfo E Nov. 9, 2019, 5:42 p.m. OK PyPy 3 TESTS 52 1076 27443200 2200
64395894 ruslanedu E Nov. 6, 2019, 3:56 p.m. OK PyPy 3 TESTS 52 1091 20582400 2200
66539974 Aita_Venkata_Rishmitha E Dec. 9, 2019, 11:08 a.m. OK Python 3 TESTS 52 1060 27852800 2200
66462793 bnaninaidu9949 E Dec. 7, 2019, 3:25 p.m. OK Python 3 TESTS 52 1075 27545600 2200
64896448 vuonghoangbntt E Nov. 14, 2019, 4:48 p.m. OK Python 3 TESTS 52 1075 27545600 2200
64359271 kabeer27 E Nov. 6, 2019, 11:16 a.m. OK Python 3 TESTS 52 1731 31027200 2200
64489184 aligh E Nov. 7, 2019, 7:07 p.m. OK Python 3 TESTS 52 1996 33689600 2200
64314999 terraformer E Nov. 5, 2019, 1:52 p.m. OK Rust TESTS 52 124 13414400 2200
65909291 yuya178 E Nov. 28, 2019, 12:16 p.m. OK Rust TESTS 52 140 9420800 2200
64598795 kobae964 E Nov. 9, 2019, 5:49 p.m. OK Rust TESTS 52 202 9625600 2200

remove filters

Back to search problems