Codeforces Round 469 (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
949 Codeforces Round 469 (Div. 1) FINISHED False 9000 211240199 March 9, 2018, 8:10 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5400 ) A Zebras PROGRAMMING greedy 1600

B"Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it. Let us denote bad days as 0 and good days as 1. Then, for example, sequences of days 0, 010, 01010 are zebras, while sequences 1, 0110, 0101 are not. Oleg tells you the story of days he lived in chronological order in form of string consisting of 0 and 1. Now you are interested if it is possible to divide Oleg's life history into several subsequences, each of which is a zebra, and the way it can be done. Each day must belong to exactly one of the subsequences. For each of the subsequences, days forming it must be ordered chronologically. Note that subsequence does not have to be a group of consecutive days. In the only line of input data there is a non-empty string s consisting of characters 0 and 1, which describes the history of Oleg's life. Its length (denoted as |s|) does not exceed 200 xe2 x80 x89000 characters. If there is a way to divide history into zebra subsequences, in the first line of output you should print an integer k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s|), the resulting number of subsequences. In the i-th of following k lines first print the integer li (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s|), which is the length of the i-th subsequence, and then li indices of days forming the subsequence. Indices must follow in ascending order. Days are numbered starting from 1. Each index from 1 to n must belong to exactly one subsequence. If there is no way to divide day history into zebra subsequences, print -1. Subsequences may be printed in any order. If there are several solutions, you may print any of them. You do not have to minimize nor maximize the value of k. "...

Tutorials

58291

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
39969635 luogu_bot3 A July 5, 2018, 1:01 a.m. OK FPC TESTS 71 889 11059200 1600
39969465 luogu_bot4 A July 5, 2018, 12:50 a.m. OK FPC TESTS 71 966 10240000 1600
39969517 luogu_bot4 A July 5, 2018, 12:53 a.m. OK FPC TESTS 71 997 10240000 1600
36388162 vjudge2 A March 18, 2018, 12:22 p.m. OK GNU C TESTS 71 93 6758400 1600
36111077 physics0523 A March 9, 2018, 10:25 a.m. OK GNU C TESTS 71 108 7475200 1600
36384486 Scut82 A March 18, 2018, 10:07 a.m. OK GNU C++ TESTS 71 31 7782400 1600
36098176 RabbitHu A March 9, 2018, 8:41 a.m. OK GNU C++ TESTS 71 46 6246400 1600
36096047 _SHENZHEBEI_ A March 9, 2018, 8:31 a.m. OK GNU C++ TESTS 71 61 45465600 1600
36736437 vjudge5 A March 30, 2018, 2:41 a.m. OK GNU C++ TESTS 71 62 9523200 1600
36518163 zhaotiensn A March 23, 2018, 1:16 a.m. OK GNU C++ TESTS 71 62 10649600 1600
39982207 Administratom A July 5, 2018, 11:24 a.m. OK GNU C++ TESTS 71 62 12288000 1600
38702478 white_noise A May 28, 2018, 6:47 p.m. OK GNU C++ TESTS 71 62 41062400 1600
36115274 Neutralzz A March 9, 2018, 12:19 p.m. OK GNU C++ TESTS 71 77 5529600 1600
36117692 TsReaper A March 9, 2018, 1:15 p.m. OK GNU C++ TESTS 71 78 4096000 1600
36098040 Likulau A March 9, 2018, 8:40 a.m. OK GNU C++ TESTS 71 78 4710400 1600
36891233 Xeonacid A April 3, 2018, 1:41 a.m. OK GNU C++11 TESTS 71 46 14643200 1600
36098597 lsonan A March 9, 2018, 8:43 a.m. OK GNU C++11 TESTS 71 46 23347200 1600
40932722 ReaLNero1 A July 30, 2018, 1:59 a.m. OK GNU C++11 TESTS 71 46 26726400 1600
36096311 PupilFop_zz A March 9, 2018, 8:31 a.m. OK GNU C++11 TESTS 71 46 43110400 1600
36682069 Georeth A March 28, 2018, 2:47 a.m. OK GNU C++11 TESTS 71 62 11366400 1600
36119121 stevenzheng2002 A March 9, 2018, 1:57 p.m. OK GNU C++11 TESTS 71 78 4710400 1600
36097176 yyqchemic A March 9, 2018, 8:36 a.m. OK GNU C++11 TESTS 71 78 4710400 1600
36119366 Camouflager A March 9, 2018, 2:05 p.m. OK GNU C++11 TESTS 71 78 4915200 1600
36092795 samjia2000 A March 9, 2018, 8:17 a.m. OK GNU C++11 TESTS 71 78 5632000 1600
36096272 Serval A March 9, 2018, 8:31 a.m. OK GNU C++11 TESTS 71 78 6041600 1600
47026844 vgarg_2.0 A Dec. 15, 2018, 7:26 a.m. OK GNU C++14 TESTS 71 62 3993600 1600
36095397 IceCocoa A March 9, 2018, 8:27 a.m. OK GNU C++14 TESTS 71 62 4096000 1600
36096735 Starlit A March 9, 2018, 8:34 a.m. OK GNU C++14 TESTS 71 62 4710400 1600
36095698 Namnamseo A March 9, 2018, 8:30 a.m. OK GNU C++14 TESTS 71 62 4710400 1600
36095369 Whalanator A March 9, 2018, 8:27 a.m. OK GNU C++14 TESTS 71 62 5427200 1600
36103985 zssky A March 9, 2018, 9:20 a.m. OK GNU C++14 TESTS 71 62 5529600 1600
36093462 Melnyk A March 9, 2018, 8:20 a.m. OK GNU C++14 TESTS 71 62 5836800 1600
36888088 lys1280023 A April 2, 2018, 7:53 p.m. OK GNU C++14 TESTS 71 62 6144000 1600
36273447 vjudge5 A March 14, 2018, 11:41 a.m. OK GNU C++14 TESTS 71 62 6246400 1600
36104704 kut_ksr1994 A March 9, 2018, 9:26 a.m. OK GNU C++14 TESTS 71 62 6451200 1600
36093803 khadaev A March 9, 2018, 8:21 a.m. OK GNU C++17 TESTS 71 62 10444800 1600
69395758 Mohammad_Yasser A Jan. 23, 2020, 6:13 a.m. OK GNU C++17 TESTS 71 77 6041600 1600
61733656 manish_joshi A Oct. 2, 2019, 5:29 p.m. OK GNU C++17 TESTS 71 77 7065600 1600
53863563 Jiangkangping A May 8, 2019, 12:37 a.m. OK GNU C++17 TESTS 71 77 7270400 1600
36252744 SadmanSOS A March 13, 2018, 2:44 p.m. OK GNU C++17 TESTS 71 77 7884800 1600
67851022 Sitleman A Dec. 29, 2019, 2:58 a.m. OK GNU C++17 TESTS 71 77 8089600 1600
60923172 Mahdi_Shokoufi A Sept. 20, 2019, 11:24 a.m. OK GNU C++17 TESTS 71 77 8601600 1600
36175488 DeLus1oN A March 10, 2018, 5:51 p.m. OK GNU C++17 TESTS 71 77 8704000 1600
36098058 Jakube A March 9, 2018, 8:40 a.m. OK GNU C++17 TESTS 71 77 10035200 1600
36095543 komendart A March 9, 2018, 8:28 a.m. OK GNU C++17 TESTS 71 77 10547200 1600
36348726 u1s1reallycai A March 17, 2018, 9:10 a.m. OK Go TESTS 71 217 47001600 1600
46738090 kusomushi A Dec. 7, 2018, 9:54 p.m. OK Java 8 TESTS 71 202 17715200 1600
36093884 tmwilliamlin168 A March 9, 2018, 8:21 a.m. OK Java 8 TESTS 71 202 24268800 1600
38200877 Darth_Jar_Jar_Binks A May 13, 2018, 8:41 p.m. OK Java 8 TESTS 71 217 26624000 1600
37295972 beroul A April 13, 2018, 7:05 p.m. OK Java 8 TESTS 71 217 27648000 1600
46006468 Ahmad_Elsagheer A Nov. 20, 2018, 5:14 p.m. OK Java 8 TESTS 71 218 14438400 1600
36275616 palayutm A March 14, 2018, 12:41 p.m. OK Java 8 TESTS 71 218 38400000 1600
40729760 aranjuda A July 25, 2018, 7:03 a.m. OK Java 8 TESTS 71 233 17920000 1600
36424579 SrapZark A March 20, 2018, 4:36 a.m. OK Java 8 TESTS 71 233 28979200 1600
36193911 SomeGuyTookMyHandleToo A March 11, 2018, 9:24 a.m. OK Java 8 TESTS 71 234 34201600 1600
56523452 zmurzagaliev A July 4, 2019, 4:02 p.m. OK Java 8 TESTS 71 234 38297600 1600
36097379 renadeen A March 9, 2018, 8:37 a.m. OK MS C# TESTS 71 249 45260800 1600
36135013 Ginstein A March 10, 2018, 3:13 a.m. OK MS C++ TESTS 71 108 8704000 1600
36213437 vjudge3 A March 12, 2018, 1:58 a.m. OK MS C++ TESTS 71 109 8704000 1600
36097761 Schullz A March 9, 2018, 8:39 a.m. OK MS C++ TESTS 71 109 10649600 1600
40909305 xiezichen A July 29, 2018, 7:49 a.m. OK MS C++ TESTS 71 124 6656000 1600
36189720 vjudge3 A March 11, 2018, 7:08 a.m. OK MS C++ TESTS 71 124 8704000 1600
36093467 waltz7l9 A March 9, 2018, 8:20 a.m. OK MS C++ TESTS 71 124 9523200 1600
37564886 vjudge1 A April 24, 2018, 6:27 a.m. OK MS C++ TESTS 71 124 10137600 1600
36346642 vjudge4 A March 17, 2018, 7:57 a.m. OK MS C++ TESTS 71 139 10137600 1600
40635599 nomiku99 A July 22, 2018, 12:39 p.m. OK MS C++ TESTS 71 249 6860800 1600
37674891 sinasaleh A April 28, 2018, 2:31 a.m. OK MS C++ TESTS 71 280 15667200 1600
55511294 BessieTheCow A June 12, 2019, 11:05 p.m. OK MS C++ 2017 TESTS 71 280 13107200 1600
51798433 index_ A March 24, 2019, 4:36 p.m. OK MS C++ 2017 TESTS 71 326 16076800 1600
36127007 mayakin A March 9, 2018, 6:37 p.m. OK PHP TESTS 71 841 76902400 1600
36126815 mayakin A March 9, 2018, 6:30 p.m. OK PHP TESTS 71 904 76902400 1600
36098381 Ferume A March 9, 2018, 8:42 a.m. OK PyPy 3 TESTS 71 389 42905600 1600
36148236 Yee_172 A March 10, 2018, 11:17 a.m. OK PyPy 3 TESTS 71 452 41369600 1600
36895218 figure0907 A April 3, 2018, 7:14 a.m. OK PyPy 3 TESTS 71 483 43622400 1600
36120625 WNG A March 9, 2018, 2:45 p.m. OK Python 2 TESTS 71 560 26624000 1600
36452035 laoliumang A March 21, 2018, 11:16 a.m. OK Python 2 TESTS 71 607 25395200 1600
36183682 nealzane A March 11, 2018, 2:56 a.m. OK Python 2 TESTS 71 670 25395200 1600
36183630 nealzane A March 11, 2018, 2:52 a.m. OK Python 2 TESTS 71 670 25395200 1600
36419283 m.boniecki A March 19, 2018, 7:24 p.m. OK Python 2 TESTS 71 686 27852800 1600
36904442 wangzpeng A April 3, 2018, 1:56 p.m. OK Python 2 TESTS 71 701 22732800 1600
36375281 s.ritam.7692 A March 18, 2018, 3 a.m. OK Python 2 TESTS 71 701 26828800 1600
36419321 tnowakow A March 19, 2018, 7:26 p.m. OK Python 2 TESTS 71 701 29388800 1600
36460829 TheDreamer979 A March 21, 2018, 5:32 p.m. OK Python 2 TESTS 71 779 22732800 1600
36461900 TheDreamer979 A March 21, 2018, 6:15 p.m. OK Python 2 TESTS 71 811 65843200 1600
36186124 mohit28rawat A March 11, 2018, 5:12 a.m. OK Python 3 TESTS 71 420 31641600 1600
37646704 abhi_vtty A April 26, 2018, 8:32 p.m. OK Python 3 TESTS 71 436 32358400 1600
37646662 gttg4286 A April 26, 2018, 8:29 p.m. OK Python 3 TESTS 71 436 32358400 1600
36402057 juebar10 A March 19, 2018, 3:17 a.m. OK Python 3 TESTS 71 436 32870400 1600
37646623 gttg4286 A April 26, 2018, 8:25 p.m. OK Python 3 TESTS 71 451 32870400 1600
36140504 SirBat A March 10, 2018, 6:59 a.m. OK Python 3 TESTS 71 483 39321600 1600
42120758 Mk_Python_v1 A Aug. 26, 2018, 12:21 p.m. OK Python 3 TESTS 71 499 25702400 1600
37127255 michael98liu A April 9, 2018, 4:40 p.m. OK Python 3 TESTS 71 514 37990400 1600
36679772 thervna A March 27, 2018, 9:37 p.m. OK Rust TESTS 71 935 10342400 1600
36424912 Ahmed_Salama A March 20, 2018, 5:10 a.m. OK Scala TESTS 71 685 54272000 1600

remove filters

Back to search problems