Codeforces Round 558 (Div. 2)

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
1163 Codeforces Round 558 (Div. 2) FINISHED False 7200 174408899 May 9, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7264 ) B2 Cat Party (Hard Edition) PROGRAMMING data structures implementation 1700

B"This problem is same as the previous one, but has larger constraints. Shiro's just moved to the new house. She wants to invite all friends of her to the house so they can play monopoly. However, her house is too small, so she can only invite one friend at a time. For each of the n days since the day Shiro moved to the new house, there will be exactly one cat coming to the Shiro's house. The cat coming in the i -th day has a ribbon with color u_i . Shiro wants to know the largest number x , such that if we consider the streak of the first x days, it is possible to remove exactly one day from this streak so that every ribbon color that has appeared among the remaining x - 1 will have the same number of occurrences. For example, consider the following sequence of u_i : [2, 2, 1, 1, 5, 4, 4, 5] . Then x = 7 makes a streak, since if we remove the leftmost u_i = 5 , each ribbon color will appear exactly twice in the prefix of x - 1 days. Note that x = 8 doesn't form a streak, since you must remove exactly one day. Since Shiro is just a cat, she is not very good at counting and needs your help finding the longest streak. The first line contains a single integer n ( 1 <= q n <= q 10^5 ) -- the total number of days. The second line contains n integers u_1, u_2, ldots, u_n ( 1 <= q u_i <= q 10^5 ) -- the colors of the ribbons the cats wear. Print a single integer x -- the largest possible streak of days. In the first example, we can choose the longest streak of 13 days, since upon removing the last day out of the streak, all of the remaining colors 1 , 2 , 3 , and 4 will have the same number of occurrences of 3 . Note that the streak can also be 10 days (by removing the 10 -th day from this streak) but we are interested in the longest streak. In the fourth example, if we take the streak of the first 6 days, we ca"...

Tutorials

66943

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
53967253 vjudge1 B2 May 10, 2019, 6:10 p.m. OK Clang++17 Diagnostics TESTS 66 358 6758400 1700
53943222 iica B2 May 10, 2019, 4:48 a.m. OK D TESTS 63 46 4300800 1700
53926117 fluffyowl B2 May 9, 2019, 4:38 p.m. OK D TESTS 63 62 4198400 1700
53960899 Denor B2 May 10, 2019, 2:06 p.m. OK Delphi TESTS 66 46 7987200 1700
53929193 Oompaloompa B2 May 9, 2019, 4:58 p.m. OK FPC TESTS 63 93 6656000 1700
54008339 eugalt B2 May 11, 2019, 10:13 p.m. OK GNU C11 TESTS 66 31 819200 1700
54068976 mahesh.rubiks B2 May 13, 2019, 3:01 p.m. OK GNU C11 TESTS 66 31 819200 1700
53941314 guduqiarui B2 May 10, 2019, 3:14 a.m. OK GNU C11 TESTS 63 31 819200 1700
54008694 eugalt B2 May 11, 2019, 10:45 p.m. OK GNU C11 TESTS 66 46 819200 1700
58158153 Alfeh B2 Aug. 2, 2019, 6:28 a.m. OK GNU C11 TESTS 66 46 819200 1700
55694294 rainboy B2 June 17, 2019, 8:16 p.m. OK GNU C11 TESTS 66 46 819200 1700
54009406 eugalt B2 May 12, 2019, 12:02 a.m. OK GNU C11 TESTS 66 46 819200 1700
53933760 about B2 May 9, 2019, 8:04 p.m. OK GNU C11 TESTS 63 46 819200 1700
54008393 eugalt B2 May 11, 2019, 10:18 p.m. OK GNU C11 TESTS 66 46 819200 1700
53929332 pengin_2000 B2 May 9, 2019, 4:59 p.m. OK GNU C11 TESTS 63 46 1228800 1700
53921256 Stay_online B2 May 9, 2019, 4:06 p.m. OK GNU C++11 TESTS 63 31 409600 1700
53945685 lzoilxy B2 May 10, 2019, 6:32 a.m. OK GNU C++11 TESTS 63 31 614400 1700
54651606 72_transformations B2 May 26, 2019, 5:47 a.m. OK GNU C++11 TESTS 66 31 614400 1700
54055487 skycrazy B2 May 13, 2019, 7:55 a.m. OK GNU C++11 TESTS 66 31 614400 1700
53949712 albertyan B2 May 10, 2019, 8:51 a.m. OK GNU C++11 TESTS 63 31 614400 1700
55736188 tabbbbbb B2 June 19, 2019, 4:12 a.m. OK GNU C++11 TESTS 66 31 819200 1700
58934429 vjudge5 B2 Aug. 17, 2019, 3:06 a.m. OK GNU C++11 TESTS 66 31 819200 1700
61321400 CLManytime B2 Sept. 26, 2019, 12:41 p.m. OK GNU C++11 TESTS 66 31 819200 1700
58367916 LLL564 B2 Aug. 6, 2019, 5:13 a.m. OK GNU C++11 TESTS 66 31 819200 1700
57377986 wangqianqian B2 July 20, 2019, 1:21 p.m. OK GNU C++11 TESTS 66 31 819200 1700
53915614 wleung_bvg B2 May 9, 2019, 3:34 p.m. OK GNU C++14 TESTS 63 31 1740800 1700
53914682 jinyo B2 May 9, 2019, 3:29 p.m. OK GNU C++14 TESTS 63 46 409600 1700
53913744 leign B2 May 9, 2019, 3:24 p.m. OK GNU C++14 TESTS 63 46 409600 1700
54650254 AshveenBansal B2 May 26, 2019, 4:47 a.m. OK GNU C++14 TESTS 66 46 512000 1700
66519686 ethan B2 Dec. 8, 2019, 9:17 p.m. OK GNU C++14 TESTS 66 46 819200 1700
68946473 pras_kash B2 Jan. 16, 2020, 4:21 p.m. OK GNU C++14 TESTS 66 46 819200 1700
66571141 vjudge1 B2 Dec. 10, 2019, 4:36 a.m. OK GNU C++14 TESTS 66 46 819200 1700
66554866 MasumBhuiyan B2 Dec. 9, 2019, 4:19 p.m. OK GNU C++14 TESTS 66 46 819200 1700
67644362 Bondo B2 Dec. 26, 2019, 9:29 a.m. OK GNU C++14 TESTS 66 46 819200 1700
66622361 siddhant1 B2 Dec. 11, 2019, 7:31 a.m. OK GNU C++14 TESTS 66 46 819200 1700
56644719 Vwsrenzk_ZC B2 July 7, 2019, 5:34 a.m. OK GNU C++17 TESTS 66 46 409600 1700
53999553 LucaSeri B2 May 11, 2019, 3:46 p.m. OK GNU C++17 TESTS 66 46 409600 1700
53944499 Bert B2 May 10, 2019, 5:44 a.m. OK GNU C++17 TESTS 63 46 409600 1700
53931547 karan2dec B2 May 9, 2019, 6:06 p.m. OK GNU C++17 TESTS 63 46 409600 1700
53929767 karan2dec B2 May 9, 2019, 5:01 p.m. OK GNU C++17 TESTS 63 46 409600 1700
53916169 DystoriaX B2 May 9, 2019, 3:37 p.m. OK GNU C++17 TESTS 63 46 409600 1700
53919828 kvk1920 B2 May 9, 2019, 3:58 p.m. OK GNU C++17 TESTS 63 46 512000 1700
69209935 N.light2000 B2 Jan. 20, 2020, 7:31 p.m. OK GNU C++17 TESTS 66 46 819200 1700
69449674 Rahul_cpp B2 Jan. 24, 2020, 5:32 a.m. OK GNU C++17 TESTS 66 46 819200 1700
69260436 kaizen_ B2 Jan. 21, 2020, 4:53 p.m. OK GNU C++17 TESTS 66 46 819200 1700
54653316 shopnobaj_raju B2 May 26, 2019, 6:49 a.m. OK Go TESTS 66 31 4505600 1700
54363442 wilcot B2 May 18, 2019, 11 p.m. OK Go TESTS 66 62 5324800 1700
53948130 Lancern B2 May 10, 2019, 8 a.m. OK Go TESTS 63 78 5324800 1700
59595715 sighduck B2 Aug. 28, 2019, 1:27 a.m. OK Go TESTS 66 109 4505600 1700
62659077 120405217 B2 Oct. 16, 2019, 4:23 a.m. OK Go TESTS 66 124 4505600 1700
53949126 polyakoff B2 May 10, 2019, 8:32 a.m. OK Java 8 TESTS 63 124 0 1700
54015009 kostasanemozalis B2 May 12, 2019, 6:03 a.m. OK Java 8 TESTS 66 124 0 1700
58134001 MubtasimShahriar B2 Aug. 1, 2019, 3:21 p.m. OK Java 8 TESTS 66 124 0 1700
55694293 Dukkha B2 June 17, 2019, 8:16 p.m. OK Java 8 TESTS 66 124 0 1700
54020395 abhi2601 B2 May 12, 2019, 9:22 a.m. OK Java 8 TESTS 66 124 0 1700
54014984 Illusions B2 May 12, 2019, 6:02 a.m. OK Java 8 TESTS 66 124 0 1700
54013820 horseprabhat625 B2 May 12, 2019, 5:09 a.m. OK Java 8 TESTS 66 124 0 1700
53992519 Nutella3000 B2 May 11, 2019, 12:56 p.m. OK Java 8 TESTS 66 124 0 1700
53967258 alipervaiz B2 May 10, 2019, 6:10 p.m. OK Java 8 TESTS 66 124 0 1700
53962010 KharYusuf B2 May 10, 2019, 2:44 p.m. OK Java 8 TESTS 66 124 0 1700
59694130 Spheniscine B2 Aug. 30, 2019, 7:42 a.m. OK Kotlin TESTS 66 280 13824000 1700
56500307 og.kostya B2 July 4, 2019, 5:59 a.m. OK Mono C# TESTS 66 62 4812800 1700
53917069 claw88 B2 May 9, 2019, 3:42 p.m. OK Mono C# TESTS 63 77 7475200 1700
53922421 eki B2 May 9, 2019, 4:13 p.m. OK Mono C# TESTS 63 93 7475200 1700
63116697 nadilk B2 Oct. 22, 2019, 9:36 a.m. OK Mono C# TESTS 66 93 21811200 1700
54413279 TrabajoNocturno B2 May 20, 2019, 11:12 a.m. OK Mono C# TESTS 66 93 79462400 1700
53929329 gaozqxin B2 May 9, 2019, 4:59 p.m. OK Mono C# TESTS 63 108 12697600 1700
53921081 sergmel B2 May 9, 2019, 4:05 p.m. OK Mono C# TESTS 63 108 14643200 1700
53925189 omikad B2 May 9, 2019, 4:32 p.m. OK Mono C# TESTS 63 108 16281600 1700
54015522 m1_k3 B2 May 12, 2019, 6:23 a.m. OK Mono C# TESTS 66 109 7475200 1700
54015393 m1_k3 B2 May 12, 2019, 6:18 a.m. OK Mono C# TESTS 66 109 9932800 1700
54094311 vjudge1 B2 May 14, 2019, 12:22 p.m. OK MS C++ TESTS 66 31 819200 1700
53985237 vjudge5 B2 May 11, 2019, 9:17 a.m. OK MS C++ TESTS 66 31 819200 1700
57303347 vjudge1 B2 July 19, 2019, 1:57 a.m. OK MS C++ TESTS 66 46 819200 1700
53983933 vjudge3 B2 May 11, 2019, 8:37 a.m. OK MS C++ TESTS 66 46 819200 1700
57775807 TianPingXing B2 July 26, 2019, 3:26 a.m. OK MS C++ TESTS 66 46 819200 1700
54243100 vjudge3 B2 May 16, 2019, 1:45 p.m. OK MS C++ TESTS 66 46 819200 1700
55187061 vjudge4 B2 June 6, 2019, 4:11 a.m. OK MS C++ TESTS 66 46 1228800 1700
54396359 vjudge5 B2 May 19, 2019, 8:30 p.m. OK MS C++ TESTS 66 46 1228800 1700
54649371 vjudge3 B2 May 26, 2019, 4:02 a.m. OK MS C++ TESTS 66 46 3584000 1700
54649386 vjudge5 B2 May 26, 2019, 4:04 a.m. OK MS C++ TESTS 66 46 3584000 1700
57777743 TianSunXing B2 July 26, 2019, 4:31 a.m. OK MS C++ 2017 TESTS 66 46 819200 1700
57750622 TianZuiXing B2 July 25, 2019, 2:40 p.m. OK MS C++ 2017 TESTS 66 46 819200 1700
53958808 R99 B2 May 10, 2019, 1:06 p.m. OK MS C++ 2017 TESTS 66 46 1228800 1700
54090363 hwangganzi B2 May 14, 2019, 10:28 a.m. OK MS C++ 2017 TESTS 66 46 1228800 1700
57728039 TianZuiXing B2 July 25, 2019, 7:45 a.m. OK MS C++ 2017 TESTS 66 46 1228800 1700
53918619 GomBu B2 May 9, 2019, 3:51 p.m. OK MS C++ 2017 TESTS 63 62 1228800 1700
53965443 CtrlAlt B2 May 10, 2019, 4:40 p.m. OK MS C++ 2017 TESTS 66 62 3174400 1700
54006162 petko_mitkov B2 May 11, 2019, 8:13 p.m. OK MS C++ 2017 TESTS 66 62 3993600 1700
64684621 ainch96 B2 Nov. 11, 2019, 11:20 a.m. OK MS C++ 2017 TESTS 66 62 7270400 1700
53915882 youx B2 May 9, 2019, 3:35 p.m. OK MS C++ 2017 TESTS 63 77 819200 1700
57749165 TianPingXing B2 July 25, 2019, 2:09 p.m. OK Perl TESTS 66 108 15667200 1700
56528864 mayakin B2 July 4, 2019, 6:33 p.m. OK PHP TESTS 66 217 14233600 1700
53951893 kbagoli1999 B2 May 10, 2019, 9:58 a.m. OK PyPy 2 TESTS 63 140 6656000 1700
53914168 Jonte_98 B2 May 9, 2019, 3:26 p.m. OK PyPy 2 TESTS 63 155 6860800 1700
67206113 aaa_bbb_ccc B2 Dec. 19, 2019, 12:29 p.m. OK PyPy 2 TESTS 66 156 6860800 1700
53915955 pajenegod B2 May 9, 2019, 3:36 p.m. OK PyPy 2 TESTS 63 171 7680000 1700
53923482 codeseeker B2 May 9, 2019, 4:20 p.m. OK PyPy 2 TESTS 63 171 9728000 1700
53970508 raj1307 B2 May 10, 2019, 8:38 p.m. OK PyPy 2 TESTS 66 171 10342400 1700
54266126 anshuman16423 B2 May 17, 2019, 6:05 a.m. OK PyPy 2 TESTS 66 171 11980800 1700
53941050 cherry_su B2 May 10, 2019, 3:02 a.m. OK PyPy 2 TESTS 63 202 11366400 1700
53937707 supachai_pay B2 May 9, 2019, 11:24 p.m. OK PyPy 2 TESTS 63 217 7475200 1700
53920320 Mukundan314 B2 May 9, 2019, 4:01 p.m. OK PyPy 2 TESTS 63 249 9932800 1700
53962432 iamprayush B2 May 10, 2019, 2:56 p.m. OK PyPy 3 TESTS 66 187 11059200 1700
53914466 Riolku B2 May 9, 2019, 3:28 p.m. OK PyPy 3 TESTS 63 187 13107200 1700
54864448 grhkm B2 May 31, 2019, 5:11 a.m. OK PyPy 3 TESTS 66 202 11161600 1700
53916604 lollihunter B2 May 9, 2019, 3:39 p.m. OK PyPy 3 TESTS 63 202 11161600 1700
53935889 malylesio B2 May 9, 2019, 9:41 p.m. OK PyPy 3 TESTS 63 217 13619200 1700
57374589 tardis39 B2 July 20, 2019, 12:05 p.m. OK PyPy 3 TESTS 66 218 10035200 1700
58395975 KAin0 B2 Aug. 6, 2019, 3:38 p.m. OK PyPy 3 TESTS 66 218 10240000 1700
53946880 sanvi_kiit B2 May 10, 2019, 7:15 a.m. OK PyPy 3 TESTS 63 218 12800000 1700
54008709 mattiasm83 B2 May 11, 2019, 10:47 p.m. OK PyPy 3 TESTS 66 233 10752000 1700
54394881 gaurav007_ B2 May 19, 2019, 7:11 p.m. OK PyPy 3 TESTS 66 233 11161600 1700
58645871 soumyasarkar1998 B2 Aug. 12, 2019, 5:45 a.m. OK Python 2 TESTS 66 327 5632000 1700
53924893 SergiiKo B2 May 9, 2019, 4:30 p.m. OK Python 2 TESTS 63 327 6451200 1700
53924847 mgor B2 May 9, 2019, 4:29 p.m. OK Python 2 TESTS 63 327 6656000 1700
55740973 shubhankarsharma00 B2 June 19, 2019, 7:23 a.m. OK Python 2 TESTS 66 342 9625600 1700
53925669 bl4ckc4t B2 May 9, 2019, 4:35 p.m. OK Python 2 TESTS 63 358 5632000 1700
53966994 Wodewarrior B2 May 10, 2019, 5:45 p.m. OK Python 2 TESTS 66 374 8704000 1700
54002800 Wodewarrior B2 May 11, 2019, 5:32 p.m. OK Python 2 TESTS 66 374 8806400 1700
53918516 davidzhou B2 May 9, 2019, 3:50 p.m. OK Python 2 TESTS 63 452 23244800 1700
54008840 eugalt B2 May 11, 2019, 11:01 p.m. OK Python 3 TESTS 66 202 13721600 1700
53976987 eugalt B2 May 11, 2019, 4:53 a.m. OK Python 3 TESTS 66 217 11878400 1700
53977099 eugalt B2 May 11, 2019, 4:59 a.m. OK Python 3 TESTS 66 218 13721600 1700
54005201 eugalt B2 May 11, 2019, 7:20 p.m. OK Python 3 TESTS 66 233 13721600 1700
53977493 eugalt B2 May 11, 2019, 5:14 a.m. OK Python 3 TESTS 66 233 13721600 1700
53977370 eugalt B2 May 11, 2019, 5:09 a.m. OK Python 3 TESTS 66 233 13721600 1700
53940462 365050244 B2 May 10, 2019, 2:34 a.m. OK Python 3 TESTS 63 249 7372800 1700
60208625 tushartyagi8750 B2 Sept. 7, 2019, 9:10 a.m. OK Python 3 TESTS 66 249 7680000 1700
54008824 eugalt B2 May 11, 2019, 10:58 p.m. OK Python 3 TESTS 66 249 13721600 1700
53994373 the_white_devil B2 May 11, 2019, 1:48 p.m. OK Python 3 TESTS 66 280 6860800 1700
56870048 Kaidora B2 July 12, 2019, 5:56 a.m. OK Ruby TESTS 66 156 13004800 1700
53920211 old_boo B2 May 9, 2019, 4 p.m. OK Ruby TESTS 63 187 16998400 1700
56869537 Kaidora B2 July 12, 2019, 5:41 a.m. OK Ruby TESTS 66 264 13004800 1700
59191695 sansen B2 Aug. 20, 2019, 9:41 p.m. OK Rust TESTS 66 31 2252800 1700
53947775 yakamoto B2 May 10, 2019, 7:47 a.m. OK Scala TESTS 63 421 0 1700
53922777 wrick B2 May 9, 2019, 4:15 p.m. OK Scala TESTS 63 608 0 1700
53926453 nafeezabrar B2 May 9, 2019, 4:40 p.m. OK Scala TESTS 63 608 4505600 1700

remove filters

Back to search problems