Codeforces Round 493 (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
997 Codeforces Round 493 (Div. 1) FINISHED False 7200 201369299 July 1, 2018, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8333 ) A Convert to Ones PROGRAMMING brute force greedy implementation math 1500

B"You've got a string a_1, a_2, ... , a_n , consisting of zeros and ones. Let's call a sequence of consecutive elements a_i, a_{i xe2 x80 x89+ xe2 x80 x891}, ldots, xe2 x80 x89a_j ( 1 <= q xe2 x80 x89i <= q xe2 x80 x89j <= q xe2 x80 x89n ) a substring of string a . You can apply the following operations any number of times: You can apply these operations in any order. It is allowed to apply the operations multiple times to the same substring. What is the minimum number of coins you need to spend to get a string consisting only of ones? The first line of input contains integers n , x and y ( 1 xe2 x80 x89 <= q xe2 x80 x89n xe2 x80 x89 <= q xe2 x80 x89300 ,000, 0 <= q x, y <= q 10^9 ) -- length of the string, cost of the first operation (substring reverse) and cost of the second operation (inverting all elements of substring). The second line contains the string a of length n , consisting of zeros and ones. Print a single integer -- the minimum total cost of operations you need to spend to get a string consisting only of ones. Print 0 , if you do not need to perform any operations. In the first sample, at first you need to reverse substring [1 ... 2] , and then you need to invert substring [2 ... 5] . Then the string was changed as follows: xc2 xab01000 xc2 xbb to xc2 xab10000 xc2 xbb to xc2 xab11111 xc2 xbb. The total cost of operations is 1 + 10 = 11 . In the second sample, at first you need to invert substring [1 ... 1] , and then you need to invert substring [3 ... 5] . Then the string was changed as follows: xc2 xab01000 xc2 xbb to xc2 xab11000 xc2 xbb to xc2 xab11111 xc2 xbb. The overall cost is 1 + 1 = 2 . In the third example, string already consists only of ones, so the answer is 0 . "...

Tutorials

60357

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
65435817 hos.lyric A Nov. 20, 2019, 1:22 p.m. OK D TESTS 115 46 4198400 1500
39826682 Gassa A July 1, 2018, 2:16 p.m. OK D TESTS 115 46 4198400 1500
42104377 vjudge1 A Aug. 25, 2018, 10:16 p.m. OK GNU C++ TESTS 115 31 0 1500
42024211 vjudge4 A Aug. 24, 2018, 11:20 a.m. OK GNU C++ TESTS 115 31 0 1500
41987849 vjudge4 A Aug. 23, 2018, 7:07 a.m. OK GNU C++ TESTS 115 31 0 1500
41381745 vjudge3 A Aug. 9, 2018, 2:46 a.m. OK GNU C++ TESTS 115 31 0 1500
40398190 ouuan A July 16, 2018, 6:23 a.m. OK GNU C++ TESTS 115 31 0 1500
39872267 fwj A July 2, 2018, 3:15 p.m. OK GNU C++ TESTS 115 31 0 1500
39855918 Siyuan A July 2, 2018, 3:26 a.m. OK GNU C++ TESTS 115 31 0 1500
41987824 hzoi2017_zyc A Aug. 23, 2018, 7:07 a.m. OK GNU C++ TESTS 115 31 0 1500
42116165 vjudge3 A Aug. 26, 2018, 9:50 a.m. OK GNU C++ TESTS 115 31 0 1500
42136372 vjudge4 A Aug. 27, 2018, 12:27 a.m. OK GNU C++ TESTS 115 31 102400 1500
44012127 iamM71 A Oct. 8, 2018, 6:46 p.m. OK GNU C11 TESTS 115 31 307200 1500
44010962 Musharaf_Hossain A Oct. 8, 2018, 6:14 p.m. OK GNU C11 TESTS 115 31 307200 1500
56559355 abcd227 A July 5, 2019, 2:02 p.m. OK GNU C11 TESTS 115 31 614400 1500
46271582 luogu_bot4 A Nov. 27, 2018, 8:35 a.m. OK GNU C++11 TESTS 115 30 102400 1500
40876370 vjudge4 A July 28, 2018, 8:40 a.m. OK GNU C++11 TESTS 115 31 0 1500
40679686 PlayfulPanda A July 23, 2018, 6:01 p.m. OK GNU C++11 TESTS 115 31 0 1500
41690439 qeatzy A Aug. 17, 2018, 2:49 p.m. OK GNU C++11 TESTS 115 31 0 1500
59204828 luogu_bot4 A Aug. 21, 2019, 6:31 a.m. OK GNU C++11 TESTS 115 31 102400 1500
59201485 luogu_bot5 A Aug. 21, 2019, 5:06 a.m. OK GNU C++11 TESTS 115 31 102400 1500
56829881 lly A July 11, 2019, 6:32 a.m. OK GNU C++11 TESTS 115 31 102400 1500
59569254 luogu_bot3 A Aug. 27, 2019, 11:56 a.m. OK GNU C++11 TESTS 115 31 102400 1500
61326279 luogu_bot1 A Sept. 26, 2019, 1:49 p.m. OK GNU C++11 TESTS 115 31 102400 1500
59204997 luogu_bot3 A Aug. 21, 2019, 6:35 a.m. OK GNU C++11 TESTS 115 31 102400 1500
39827665 Medeowex A July 1, 2018, 2:19 p.m. OK GNU C++14 TESTS 115 30 307200 1500
39823570 apiadu A July 1, 2018, 2:09 p.m. OK GNU C++14 TESTS 115 30 307200 1500
39845609 Yazmau A July 1, 2018, 5:25 p.m. OK GNU C++14 TESTS 115 30 1024000 1500
68118612 udit19 A Jan. 3, 2020, 12:26 p.m. OK GNU C++14 TESTS 115 30 1536000 1500
39866888 ykn1 A July 2, 2018, 11:50 a.m. OK GNU C++14 TESTS 115 31 0 1500
39868149 perchema A July 2, 2018, 12:36 p.m. OK GNU C++14 TESTS 115 31 0 1500
48300695 giuseppe55 A Jan. 12, 2019, 4:45 p.m. OK GNU C++14 TESTS 115 31 0 1500
48689438 YaroslavBulyna A Jan. 21, 2019, 4:53 p.m. OK GNU C++14 TESTS 115 31 0 1500
49369125 MELNIKOFF_OLEG A Feb. 2, 2019, 4:31 p.m. OK GNU C++14 TESTS 115 31 0 1500
39847410 Svlad_Cjelli A July 1, 2018, 6:03 p.m. OK GNU C++14 TESTS 115 31 0 1500
39825446 zjhl2 A July 1, 2018, 2:13 p.m. OK GNU C++17 TESTS 115 30 307200 1500
39827739 TonySnark A July 1, 2018, 2:19 p.m. OK GNU C++17 TESTS 115 30 1024000 1500
54795835 I_Hate_Maths A May 29, 2019, 9:33 a.m. OK GNU C++17 TESTS 115 30 1126400 1500
48868633 asd111 A Jan. 24, 2019, 4:45 a.m. OK GNU C++17 TESTS 115 30 1331200 1500
39824246 fram A July 1, 2018, 2:11 p.m. OK GNU C++17 TESTS 115 31 0 1500
68382107 user202729_ A Jan. 8, 2020, 2:25 a.m. OK GNU C++17 TESTS 115 31 307200 1500
69418884 Prosperity A Jan. 23, 2020, 1:51 p.m. OK GNU C++17 TESTS 115 31 307200 1500
69418773 Prosperity A Jan. 23, 2020, 1:49 p.m. OK GNU C++17 TESTS 115 31 307200 1500
66523764 Lrztxdy A Dec. 9, 2019, 2:30 a.m. OK GNU C++17 TESTS 115 31 307200 1500
61089802 fer_malheiros A Sept. 22, 2019, 8:30 p.m. OK GNU C++17 TESTS 115 31 307200 1500
60555936 vjudge1 A Sept. 14, 2019, 2:21 p.m. OK Go TESTS 115 46 0 1500
60530453 WangJialei A Sept. 14, 2019, 12:11 p.m. OK Go TESTS 115 46 0 1500
39894482 mbrc A July 3, 2018, 1:02 p.m. OK Haskell TESTS 115 77 14848000 1500
69647722 adamjamil jdurie A Jan. 28, 2020, 2:53 a.m. OK Java 11 TESTS 115 202 0 1500
49641624 idgaf A Feb. 8, 2019, 10:36 p.m. OK Java 8 TESTS 115 109 0 1500
40035182 Nutella3000 A July 6, 2018, 4:13 p.m. OK Java 8 TESTS 115 124 0 1500
63268754 ZhiYuuan A Oct. 24, 2019, 2:31 a.m. OK Java 8 TESTS 115 124 0 1500
63097699 goyalnikhil064 A Oct. 21, 2019, 9:32 p.m. OK Java 8 TESTS 115 124 0 1500
54485243 lebaur A May 22, 2019, 12:48 p.m. OK Java 8 TESTS 115 124 0 1500
53183226 zmurzagaliev A April 23, 2019, 8:47 a.m. OK Java 8 TESTS 115 124 0 1500
42440673 KulikAlex A Sept. 3, 2018, 8:25 p.m. OK Java 8 TESTS 115 124 0 1500
39929470 tri A July 3, 2018, 4:54 p.m. OK Java 8 TESTS 115 139 0 1500
39847748 ViciousCoder A July 1, 2018, 6:14 p.m. OK Java 8 TESTS 115 139 0 1500
39845762 StayAwayFromBitches A July 1, 2018, 5:29 p.m. OK Java 8 TESTS 115 139 0 1500
55568458 og.kostya A June 14, 2019, 5:01 p.m. OK Mono C# TESTS 115 62 1126400 1500
51127403 nemars A March 10, 2019, 12:17 p.m. OK Mono C# TESTS 115 62 4710400 1500
62250396 vjudge4 A Oct. 10, 2019, 9:06 a.m. OK MS C++ TESTS 115 31 307200 1500
61763214 vjudge1 A Oct. 3, 2019, 7:47 a.m. OK MS C++ TESTS 115 31 307200 1500
60530973 vjudge1 A Sept. 14, 2019, 12:27 p.m. OK MS C++ TESTS 115 31 307200 1500
60530522 vjudge5 A Sept. 14, 2019, 12:13 p.m. OK MS C++ TESTS 115 31 307200 1500
54241347 vjudge4 A May 16, 2019, 1:05 p.m. OK MS C++ TESTS 115 31 307200 1500
44757994 LoneFox A Oct. 24, 2018, 4:53 a.m. OK MS C++ TESTS 115 31 307200 1500
41404878 vjudge3 A Aug. 9, 2018, 4:01 p.m. OK MS C++ TESTS 115 31 307200 1500
41398936 vjudge1 A Aug. 9, 2018, 12:36 p.m. OK MS C++ TESTS 115 31 307200 1500
62335725 vjudge2 A Oct. 11, 2019, 12:54 a.m. OK MS C++ TESTS 115 31 307200 1500
66749881 vjudge4 A Dec. 13, 2019, 5:25 a.m. OK MS C++ TESTS 115 31 307200 1500
54603901 Dragostan A May 25, 2019, 9:26 a.m. OK MS C++ 2017 TESTS 115 31 307200 1500
51301793 rootuser A March 14, 2019, 2:45 p.m. OK MS C++ 2017 TESTS 115 31 921600 1500
56783850 eyesofgod123 A July 10, 2019, 7:29 a.m. OK MS C++ 2017 TESTS 115 31 921600 1500
63389706 CtrlAlt A Oct. 25, 2019, 2:49 p.m. OK MS C++ 2017 TESTS 115 31 921600 1500
64675168 yuanyuan2048 A Nov. 11, 2019, 7:44 a.m. OK MS C++ 2017 TESTS 115 31 1024000 1500
67516356 Mad112233 A Dec. 24, 2019, 10:59 a.m. OK MS C++ 2017 TESTS 115 46 5120000 1500
61603497 vjudge3 A Oct. 1, 2019, 11:54 a.m. OK MS C++ 2017 TESTS 115 46 12083200 1500
39875761 fruha A July 2, 2018, 5:56 p.m. OK PascalABC.NET TESTS 115 62 614400 1500
39851358 sasasagagaga A July 1, 2018, 9:08 p.m. OK PyPy 2 TESTS 115 124 1228800 1500
60640070 soumyasarkar1998 A Sept. 15, 2019, 3:09 p.m. OK PyPy 2 TESTS 115 139 1228800 1500
40674463 desiguy A July 23, 2018, 2:32 p.m. OK PyPy 2 TESTS 115 140 6348800 1500
40674416 desiguy A July 23, 2018, 2:31 p.m. OK PyPy 2 TESTS 115 140 7065600 1500
44828130 test616.cpp A Oct. 25, 2018, 7:14 a.m. OK PyPy 2 TESTS 115 155 1536000 1500
49184281 TriNguyen17 A Jan. 30, 2019, 4:48 a.m. OK PyPy 3 TESTS 115 140 3276800 1500
67461874 shivammishra A Dec. 23, 2019, 9:29 a.m. OK PyPy 3 TESTS 115 171 2969600 1500
67354906 hjq000 A Dec. 21, 2019, 12:16 p.m. OK PyPy 3 TESTS 115 171 2969600 1500
65312050 Mohamed_Ayman A Nov. 18, 2019, 3:42 p.m. OK PyPy 3 TESTS 115 171 2969600 1500
63933326 lowoncode A Oct. 31, 2019, 2:56 p.m. OK PyPy 3 TESTS 115 171 3276800 1500
61514861 irza_law A Sept. 29, 2019, 5:10 p.m. OK PyPy 3 TESTS 115 171 3276800 1500
39823471 --d A July 1, 2018, 2:09 p.m. OK PyPy 3 TESTS 115 171 3276800 1500
58563631 duongle1 A Aug. 11, 2019, 6:57 a.m. OK PyPy 3 TESTS 115 171 3379200 1500
61228564 UTMoonlight A Sept. 24, 2019, 3:55 p.m. OK PyPy 3 TESTS 115 171 10752000 1500
69812209 KrishRawat A Jan. 30, 2020, 4:50 a.m. OK PyPy 3 TESTS 115 186 12800000 1500
40012988 nealzane A July 5, 2018, 10:10 p.m. OK Python 2 TESTS 115 187 614400 1500
40233918 taiks A July 12, 2018, 1:39 p.m. OK Python 2 TESTS 115 187 2764800 1500
39882706 migyur A July 3, 2018, 3:29 a.m. OK Python 2 TESTS 115 218 716800 1500
39846295 Ali_Pi A July 1, 2018, 5:37 p.m. OK Python 2 TESTS 115 233 307200 1500
44828193 test616.cpp A Oct. 25, 2018, 7:15 a.m. OK Python 2 TESTS 115 233 614400 1500
39825242 nwi A July 1, 2018, 2:13 p.m. OK Python 2 TESTS 115 233 3276800 1500
39854756 Memory_qianxiao A July 2, 2018, 2:10 a.m. OK Python 3 TESTS 115 124 1024000 1500
42121209 Mk_Python_v1 A Aug. 26, 2018, 12:34 p.m. OK Python 3 TESTS 115 124 3174400 1500
39871284 Yee_172 A July 2, 2018, 2:33 p.m. OK Python 3 TESTS 115 124 3174400 1500
40841966 bloubloub A July 27, 2018, 9:58 a.m. OK Python 3 TESTS 115 124 3891200 1500
52945570 gaidash A April 18, 2019, 11:24 a.m. OK Python 3 TESTS 115 124 4096000 1500
52945282 gaidash A April 18, 2019, 11:17 a.m. OK Python 3 TESTS 115 124 4096000 1500
47802979 whatshisbucket A Jan. 1, 2019, 3:12 a.m. OK Python 3 TESTS 115 140 1024000 1500
40377492 pedrofreire A July 15, 2018, 11:56 a.m. OK Python 3 TESTS 115 155 1024000 1500
45398300 Jesse123 A Nov. 7, 2018, 6:39 a.m. OK Python 3 TESTS 115 156 3891200 1500
39845571 dpforest A July 1, 2018, 5:23 p.m. OK Python 3 TESTS 115 170 1024000 1500

remove filters

Back to search problems