Codeforces Round 406 (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
786 Codeforces Round 406 (Div. 1) FINISHED False 7200 241541699 March 23, 2017, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2912 ) C Till I Collapse PROGRAMMING data structures divide and conquer #data structures_divide and conquer 2600

B"Rick and Morty want to find MR. PBH and they can't do it alone. So they need of Mr. Meeseeks. They Have generated n Mr. Meeseeks, standing in a line numbered from 1 to n. Each of them has his own color. i-th Mr. Meeseeks' color is ai. Rick and Morty are gathering their army and they want to divide Mr. Meeseeks into some squads. They don't want their squads to be too colorful, so each squad should have Mr. Meeseeks of at most k different colors. Also each squad should be a continuous subarray of Mr. Meeseeks in the line. Meaning that for each 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89e xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, if Mr. Meeseeks number i and Mr. Meeseeks number j are in the same squad then Mr. Meeseeks number e should be in that same squad. Also, each squad needs its own presidio, and building a presidio needs money, so they want the total number of squads to be minimized. Rick and Morty haven't finalized the exact value of k, so in order to choose it, for each k between 1 and n (inclusive) need to know the minimum number of presidios needed. The first line of input contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- number of Mr. Meeseeks. The second line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an separated by spaces (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- colors of Mr. Meeseeks in order they standing in a line. In the first and only line of input print n integers separated by spaces. i-th integer should be the minimum number of presidios needed if the value of k is i. For the first sample testcase, some optimal ways of dividing army into squads for each k are: For the second testcase, some optimal ways of dividing army into squads for each k are: "...

Tutorials

Codeforces Round #406 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
26493367 jkxjkx1031 C April 19, 2017, 10:51 a.m. OK GNU C TESTS 35 592 64409600 2600
27480849 laofudasuan C June 1, 2017, 8:47 a.m. OK GNU C++ TESTS 35 93 6451200 2600
27480807 laofudasuan C June 1, 2017, 8:44 a.m. OK GNU C++ TESTS 35 109 6451200 2600
27009263 vjudge1 C May 11, 2017, 9:25 a.m. OK GNU C++ TESTS 35 156 13004800 2600
25777733 RNS_CUS C March 24, 2017, 3:54 p.m. OK GNU C++ TESTS 35 171 14540800 2600
25966247 SpoonsAN C March 31, 2017, 1:43 a.m. OK GNU C++ TESTS 35 171 15052800 2600
25786038 alexma C March 25, 2017, 2:16 a.m. OK GNU C++ TESTS 35 171 15052800 2600
25972398 CJQ_PP C March 31, 2017, 9:19 a.m. OK GNU C++ TESTS 35 186 15052800 2600
25823289 vjudge2 C March 26, 2017, 4:07 p.m. OK GNU C++ TESTS 35 186 43929600 2600
25966688 zyding C March 31, 2017, 2:35 a.m. OK GNU C++ TESTS 35 187 16281600 2600
40225430 vjudge5 C July 12, 2018, 8:41 a.m. OK GNU C++ TESTS 35 202 15360000 2600
28673033 ConnorZhong C July 18, 2017, 4:03 p.m. OK GNU C++11 TESTS 35 124 28979200 2600
25770297 triploblastic C March 24, 2017, 11:11 a.m. OK GNU C++11 TESTS 35 156 4505600 2600
49686429 LudwigVanBeethoven C Feb. 10, 2019, 7:26 a.m. OK GNU C++11 TESTS 35 156 12390400 2600
46690226 ltf0501 C Dec. 6, 2018, 4:05 p.m. OK GNU C++11 TESTS 35 156 13004800 2600
28673072 ConnorZhong C July 18, 2017, 4:05 p.m. OK GNU C++11 TESTS 35 156 14848000 2600
26771395 Minology C April 30, 2017, 4:19 p.m. OK GNU C++11 TESTS 35 156 15052800 2600
55521951 jkz C June 13, 2019, 9 a.m. OK GNU C++11 TESTS 35 171 13414400 2600
25772677 TaoSama C March 24, 2017, 12:35 p.m. OK GNU C++11 TESTS 35 171 14438400 2600
25872642 vjudge5 C March 28, 2017, 12:04 p.m. OK GNU C++11 TESTS 35 171 15052800 2600
25772179 Y_UME C March 24, 2017, 12:17 p.m. OK GNU C++11 TESTS 35 171 15052800 2600
40982002 ReaLNero1 C July 30, 2018, 6:13 p.m. OK GNU C++14 TESTS 35 109 3788800 2600
25782951 sereja589 C March 24, 2017, 8:37 p.m. OK GNU C++14 TESTS 35 109 5632000 2600
25753485 maxplus C March 23, 2017, 5:43 p.m. OK GNU C++14 TESTS 35 140 4300800 2600
25753238 maxplus C March 23, 2017, 5:38 p.m. OK GNU C++14 TESTS 35 155 4300800 2600
25749605 maxplus C March 23, 2017, 4:44 p.m. OK GNU C++14 TESTS 35 156 4403200 2600
25953227 Kreyyy C March 30, 2017, 1:08 p.m. OK GNU C++14 TESTS 35 156 15155200 2600
25981695 xuanquang1999 C March 31, 2017, 2:51 p.m. OK GNU C++14 TESTS 35 156 15564800 2600
28673373 szawinis C July 18, 2017, 4:21 p.m. OK GNU C++14 TESTS 35 156 15769600 2600
25886285 lys1280023 C March 29, 2017, 2:31 a.m. OK GNU C++14 TESTS 35 156 15872000 2600
25811122 victoragnez C March 26, 2017, 5:20 a.m. OK GNU C++14 TESTS 35 171 14540800 2600
60292000 user202729_ C Sept. 9, 2019, 7:51 a.m. OK GNU C++17 TESTS 35 171 4300800 2600
53688245 robot-dreams C May 3, 2019, 2:46 a.m. OK GNU C++17 TESTS 35 171 12697600 2600
50052824 err0r C Feb. 17, 2019, 8:52 a.m. OK GNU C++17 TESTS 35 171 14336000 2600
48109535 ppavic C Jan. 9, 2019, 8:21 a.m. OK GNU C++17 TESTS 35 187 13721600 2600
61116959 hjk1030 C Sept. 23, 2019, 1:10 p.m. OK GNU C++17 TESTS 35 202 14745600 2600
48093828 jklepec C Jan. 8, 2019, 3:28 p.m. OK GNU C++17 TESTS 35 218 72806400 2600
40225443 CalvinJin C July 12, 2018, 8:41 a.m. OK GNU C++17 TESTS 35 233 15462400 2600
48093646 jklepec C Jan. 8, 2019, 3:21 p.m. OK GNU C++17 TESTS 35 233 72601600 2600
60525512 SGHD C Sept. 14, 2019, 10:13 a.m. OK GNU C++17 TESTS 35 296 1638400 2600
58669271 Undead_one C Aug. 12, 2019, 1:45 p.m. OK GNU C++17 TESTS 35 296 23961600 2600
25756540 husanovSh C March 23, 2017, 7:20 p.m. OK Java 8 TESTS 35 545 20684800 2600
25741766 fnch C March 23, 2017, 3:37 p.m. OK Java 8 TESTS 35 608 20582400 2600
27270264 MazzForces C May 21, 2017, 4 p.m. OK Java 8 TESTS 35 717 82534400 2600
25750798 meijun C March 23, 2017, 4:56 p.m. OK Java 8 TESTS 35 826 20684800 2600
25783648 MazzForces C March 24, 2017, 9:23 p.m. OK Java 8 TESTS 35 951 40140800 2600
27273353 MazzForces C May 21, 2017, 8:20 p.m. OK Java 8 TESTS 35 966 82534400 2600
65235374 pranjal6645 C Nov. 17, 2019, 7 a.m. OK Java 8 TESTS 35 1200 0 2600
25761429 poikniok C March 24, 2017, 2:23 a.m. OK Java 8 TESTS 35 1466 20684800 2600
68567886 Ahmad C Jan. 10, 2020, 11:05 p.m. OK Java 8 TESTS 35 1668 160358400 2600
25755298 poikniok C March 23, 2017, 6:30 p.m. OK Java 8 TESTS 35 1669 20684800 2600
27433687 Alex7 C May 29, 2017, 5:54 p.m. OK MS C++ TESTS 35 218 21606400 2600
56702185 vjudge2 C July 8, 2019, 9:36 a.m. OK MS C++ TESTS 35 451 121446400 2600
25742732 DimonK C March 23, 2017, 3:43 p.m. OK MS C++ TESTS 35 483 258560000 2600
25746592 veschii_nevstrui C March 23, 2017, 4:13 p.m. OK MS C++ TESTS 35 717 93388800 2600
26696973 BahmanR C April 27, 2017, 6:26 a.m. OK MS C++ TESTS 35 733 3174400 2600
30214384 AleksanderBalobanov C Sept. 8, 2017, 11:29 p.m. OK MS C++ TESTS 35 748 118169600 2600
26074556 vjudge4 C April 2, 2017, 9:43 a.m. OK MS C++ TESTS 35 795 3174400 2600
25755780 Roms C March 23, 2017, 6:49 p.m. OK MS C++ TESTS 35 889 3276800 2600
25898725 Yurik C March 29, 2017, 3:06 p.m. OK MS C++ TESTS 35 997 259072000 2600
56734946 vjudge2 C July 9, 2019, 4:31 a.m. OK MS C++ TESTS 35 1482 1228800 2600

remove filters

Back to search problems