Codeforces Round 572 (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
1189 Codeforces Round 572 (Div. 2) FINISHED False 7200 169484099 July 5, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10624 ) C Candies! PROGRAMMING data structures dp implementation math 1400

B"Consider a sequence of digits of length 2^k [a_1, a_2, ldots, a_{2^k}] . We perform the following operation with it: replace pairs (a_{2i+1}, a_{2i+2}) with (a_{2i+1} + a_{2i+2}) bmod 10 for 0 <= i<2^{k-1} . For every i where a_{2i+1} + a_{2i+2} ge 10 we get a candy! As a result, we will get a sequence of length 2^{k-1} . Less formally, we partition sequence of length 2^k into 2^{k-1} pairs, each consisting of 2 numbers: the first pair consists of the first and second numbers, the second of the third and fourth ldots , the last pair consists of the ( 2^k-1 )-th and ( 2^k )-th numbers. For every pair such that sum of numbers in it is at least 10 , we get a candy. After that, we replace every pair of numbers with a remainder of the division of their sum by 10 (and don't change the order of the numbers). Perform this operation with a resulting array until it becomes of length 1 . Let f([a_1, a_2, ldots, a_{2^k}]) denote the number of candies we get in this process. For example: if the starting sequence is [8, 7, 3, 1, 7, 0, 9, 4] then: After the first operation the sequence becomes [(8 + 7) bmod 10, (3 + 1) bmod 10, (7 + 0) bmod 10, (9 + 4) bmod 10] = [5, 4, 7, 3] , and we get 2 candies as 8 + 7 ge 10 and 9 + 4 ge 10 . After the second operation the sequence becomes [(5 + 4) bmod 10, (7 + 3) bmod 10] = [9, 0] , and we get one more candy as 7 + 3 ge 10 . After the final operation sequence becomes [(9 + 0) bmod 10] = [9] . Therefore, f([8, 7, 3, 1, 7, 0, 9, 4]) = 3 as we got 3 candies in total. You are given a sequence of digits of length n s_1, s_2, ldots s_n . You have to answer q queries of the form (l_i, r_i) , where for i -th query you have to output f([s_{l_i}, s_{l_i+1}, ldots, s_{r_i}]) . It is guaranteed that r_i-l_i+1 is o"...

Tutorials

Editorial of Codeforces Round #572

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56628923 arounderstands C July 6, 2019, 3:16 p.m. OK Clang++17 Diagnostics TESTS 18 140 0 1400
56632023 szfck C July 6, 2019, 4:57 p.m. OK Clang++17 Diagnostics TESTS 18 1980 1024000 1400
56825466 iica C July 11, 2019, 3:52 a.m. OK D TESTS 18 405 125849600 1400
56574651 LaSWeeG C July 5, 2019, 3:43 p.m. OK Delphi TESTS 18 92 819200 1400
56576697 EgorShibaev C July 5, 2019, 3:51 p.m. OK FPC TESTS 18 358 1638400 1400
56578037 TShT C July 5, 2019, 3:56 p.m. OK FPC TESTS 18 373 3174400 1400
62171854 kaiboy C Oct. 9, 2019, 1:31 a.m. OK GNU C11 TESTS 18 358 409600 1400
56736315 gregr C July 9, 2019, 5:28 a.m. OK GNU C11 TESTS 18 373 819200 1400
56842623 Mary_super_star C July 11, 2019, 12:13 p.m. OK GNU C11 TESTS 18 373 1228800 1400
57184244 Alfeh C July 17, 2019, 8:12 a.m. OK GNU C11 TESTS 18 374 409600 1400
61020010 nikhilreddy123 C Sept. 21, 2019, 2:20 p.m. OK GNU C11 TESTS 18 374 409600 1400
56598458 rainboy C July 5, 2019, 9:09 p.m. OK GNU C11 TESTS 18 374 409600 1400
56810315 0wuming0 C July 10, 2019, 3:45 p.m. OK GNU C11 TESTS 18 374 819200 1400
57463314 cs234_shrey C July 21, 2019, 2:34 p.m. OK GNU C11 TESTS 18 374 819200 1400
56586314 coderbd C July 5, 2019, 4:38 p.m. OK GNU C11 TESTS 18 374 819200 1400
57464343 Snoopysfriend C July 21, 2019, 2:57 p.m. OK GNU C11 TESTS 18 374 819200 1400
56620974 207M C July 6, 2019, 11:55 a.m. OK GNU C++11 TESTS 18 31 409600 1400
56620989 luogu_bot5 C July 6, 2019, 11:56 a.m. OK GNU C++11 TESTS 18 31 409600 1400
57899808 ultoxtung C July 28, 2019, 3:11 p.m. OK GNU C++11 TESTS 18 31 819200 1400
56619359 Frame233 C July 6, 2019, 11:20 a.m. OK GNU C++11 TESTS 18 46 204800 1400
56603125 luogu_bot1 C July 6, 2019, 2:25 a.m. OK GNU C++11 TESTS 18 46 307200 1400
56580482 bcr_233 C July 5, 2019, 4:07 p.m. OK GNU C++11 TESTS 18 46 307200 1400
56614691 FFjet C July 6, 2019, 9:03 a.m. OK GNU C++11 TESTS 18 46 409600 1400
65349441 Heartbeat666 C Nov. 19, 2019, 1:47 p.m. OK GNU C++11 TESTS 18 46 409600 1400
58472012 hz2016 C Aug. 9, 2019, 1:05 a.m. OK GNU C++11 TESTS 18 46 409600 1400
57733769 GCCCCCCC C July 25, 2019, 9:19 a.m. OK GNU C++11 TESTS 18 46 409600 1400
56583431 vishnu_m C July 5, 2019, 4:22 p.m. OK GNU C++14 TESTS 18 46 409600 1400
56622635 Linkus C July 6, 2019, 12:29 p.m. OK GNU C++14 TESTS 18 46 2048000 1400
68004987 lybzscyzb C Dec. 31, 2019, 12:45 p.m. OK GNU C++14 TESTS 18 62 409600 1400
56818825 ttepu C July 10, 2019, 9:20 p.m. OK GNU C++14 TESTS 18 77 409600 1400
68005092 vjudge5 C Dec. 31, 2019, 12:48 p.m. OK GNU C++14 TESTS 18 77 409600 1400
56591623 rakhejaforu.ar C July 5, 2019, 5:43 p.m. OK GNU C++14 TESTS 18 77 409600 1400
56605402 tjd229 C July 6, 2019, 4:11 a.m. OK GNU C++14 TESTS 18 77 409600 1400
56592368 luciferkingofthehell C July 5, 2019, 5:54 p.m. OK GNU C++14 TESTS 18 77 819200 1400
56595027 DragonDragneel C July 5, 2019, 6:57 p.m. OK GNU C++14 TESTS 18 77 819200 1400
57972575 efimmanevich C July 30, 2019, 6:33 a.m. OK GNU C++14 TESTS 18 77 819200 1400
57094465 lesskreker C July 15, 2019, 11:48 a.m. OK GNU C++17 TESTS 18 46 409600 1400
57130271 t_swizzle141 C July 16, 2019, 6:50 a.m. OK GNU C++17 TESTS 18 46 921600 1400
64748467 thtsshz_bgwrswh C Nov. 12, 2019, 2:22 p.m. OK GNU C++17 TESTS 18 62 409600 1400
56754540 AlessioZeni C July 9, 2019, 1:19 p.m. OK GNU C++17 TESTS 18 62 409600 1400
57076154 vjudge2 C July 15, 2019, 5:17 a.m. OK GNU C++17 TESTS 18 77 409600 1400
66680830 lijiatu C Dec. 12, 2019, 1:03 p.m. OK GNU C++17 TESTS 18 77 409600 1400
56675180 hansc3380 C July 7, 2019, 3:06 p.m. OK GNU C++17 TESTS 18 77 409600 1400
56879491 _liquid C July 12, 2019, 9:43 a.m. OK GNU C++17 TESTS 18 77 409600 1400
69389868 vjudge1 C Jan. 23, 2020, 2:38 a.m. OK GNU C++17 TESTS 18 77 819200 1400
59251396 Mynesis C Aug. 22, 2019, 4:10 a.m. OK GNU C++17 TESTS 18 77 819200 1400
56778208 Miron95 C July 10, 2019, 4:24 a.m. OK Go TESTS 18 187 0 1400
59956345 sighduck C Sept. 3, 2019, 4:19 p.m. OK Go TESTS 18 202 4505600 1400
68051063 TadijaSebez C Jan. 1, 2020, 6:52 p.m. OK Go TESTS 18 233 7577600 1400
61255547 WintersCurse C Sept. 25, 2019, 9:56 a.m. OK Go TESTS 18 264 23244800 1400
58334472 Johanan C Aug. 5, 2019, 10:54 a.m. OK Haskell TESTS 18 733 51507200 1400
56591783 old_boo C July 5, 2019, 5:45 p.m. OK Haskell TESTS 18 1091 114585600 1400
68998404 machhra C Jan. 17, 2020, 6:24 p.m. OK Java 11 TESTS 18 233 0 1400
64657736 zekigurbuz C Nov. 10, 2019, 7:47 p.m. OK Java 11 TESTS 18 889 0 1400
69526761 shubh_jha98 C Jan. 25, 2020, 3:23 p.m. OK Java 11 TESTS 18 1263 19046400 1400
68892471 zoeycf C Jan. 16, 2020, 2:57 a.m. OK Java 11 TESTS 18 1450 18534400 1400
56608468 rahsutamrev C July 6, 2019, 6:08 a.m. OK Java 8 TESTS 18 124 0 1400
56639111 heet_2201 C July 6, 2019, 10:55 p.m. OK Java 8 TESTS 18 124 0 1400
56749029 Ad-007 C July 9, 2019, 11:10 a.m. OK Java 8 TESTS 18 139 0 1400
56587345 dsh_bc C July 5, 2019, 4:45 p.m. OK Java 8 TESTS 18 139 0 1400
57827678 chojh1222 C July 27, 2019, 4:20 a.m. OK Java 8 TESTS 18 140 0 1400
57016724 richboy C July 14, 2019, 11:58 a.m. OK Java 8 TESTS 18 140 0 1400
56815990 thisSideAnonymous C July 10, 2019, 7:11 p.m. OK Java 8 TESTS 18 140 0 1400
56586371 KharYusuf C July 5, 2019, 4:39 p.m. OK Java 8 TESTS 18 140 0 1400
56579542 vaibhavpulastya C July 5, 2019, 4:03 p.m. OK Java 8 TESTS 18 140 0 1400
56578118 Mann_27__ C July 5, 2019, 3:56 p.m. OK Java 8 TESTS 18 140 0 1400
56861861 kuzAnatoliy C July 11, 2019, 11:26 p.m. OK JavaScript TESTS 18 545 6860800 1400
56617841 amirrr C July 6, 2019, 10:34 a.m. OK Kotlin TESTS 18 202 0 1400
56869891 Lovinix C July 12, 2019, 5:51 a.m. OK Kotlin TESTS 18 233 0 1400
56599753 Spheniscine C July 5, 2019, 10:24 p.m. OK Kotlin TESTS 18 327 1228800 1400
63022089 david_varela C Oct. 20, 2019, 2:54 p.m. OK Kotlin TESTS 18 327 1331200 1400
56599764 sashamc C July 5, 2019, 10:25 p.m. OK Kotlin TESTS 18 405 7577600 1400
56599862 Tlatoani C July 5, 2019, 10:33 p.m. OK Kotlin TESTS 18 421 0 1400
57585661 Flame239 C July 23, 2019, 10:32 a.m. OK Kotlin TESTS 18 966 307200 1400
56682700 akdsfiqewori C July 7, 2019, 7:37 p.m. OK Kotlin TESTS 18 998 1433600 1400
57118803 arsee C July 15, 2019, 10:37 p.m. OK Kotlin TESTS 18 1106 3891200 1400
56586255 wbars C July 5, 2019, 4:38 p.m. OK Kotlin TESTS 18 1170 0 1400
56608893 og.kostya C July 6, 2019, 6:20 a.m. OK Mono C# TESTS 18 78 2764800 1400
56586389 fr0st C July 5, 2019, 4:39 p.m. OK Mono C# TESTS 18 156 15360000 1400
56586634 Yupiteru C July 5, 2019, 4:40 p.m. OK Mono C# TESTS 18 171 13721600 1400
56695457 treasuryonly C July 8, 2019, 6:46 a.m. OK Mono C# TESTS 18 171 13824000 1400
62934423 nastya1199 C Oct. 19, 2019, 1:40 p.m. OK Mono C# TESTS 18 701 11264000 1400
56617043 Giangvp C July 6, 2019, 10:10 a.m. OK Mono C# TESTS 18 748 9932800 1400
56676613 fastnoise C July 7, 2019, 3:50 p.m. OK Mono C# TESTS 18 811 11776000 1400
56589832 Jarjar314 C July 5, 2019, 5 p.m. OK Mono C# TESTS 18 811 19456000 1400
57858945 NEvOl C July 27, 2019, 4:36 p.m. OK Mono C# TESTS 18 982 41984000 1400
56713918 thetansquared C July 8, 2019, 1:48 p.m. OK Mono C# TESTS 18 1247 120217600 1400
57838165 TianPingXing C July 27, 2019, 8:19 a.m. OK MS C++ TESTS 18 62 409600 1400
56708074 vjudge3 C July 8, 2019, 11:47 a.m. OK MS C++ TESTS 18 62 409600 1400
56848918 vjudge2 C July 11, 2019, 2:48 p.m. OK MS C++ TESTS 18 62 819200 1400
57134289 vjudge3 C July 16, 2019, 8:19 a.m. OK MS C++ TESTS 18 62 819200 1400
69083065 rures C Jan. 19, 2020, 7:13 a.m. OK MS C++ TESTS 18 62 1126400 1400
61551678 vjudge1 C Sept. 30, 2019, 12:41 p.m. OK MS C++ TESTS 18 77 409600 1400
56706222 vjudge4 C July 8, 2019, 11:10 a.m. OK MS C++ TESTS 18 77 409600 1400
56702583 vjudge4 C July 8, 2019, 9:49 a.m. OK MS C++ TESTS 18 77 409600 1400
56665489 vjudge4 C July 7, 2019, 11:05 a.m. OK MS C++ TESTS 18 77 409600 1400
57848779 TianPingXing C July 27, 2019, 12:16 p.m. OK MS C++ TESTS 18 77 409600 1400
57043393 blgpm C July 14, 2019, 3:48 p.m. OK MS C++ 2017 TESTS 18 108 409600 1400
56588066 2018030401051 C July 5, 2019, 4:49 p.m. OK MS C++ 2017 TESTS 18 109 409600 1400
57200123 vjudge3 C July 17, 2019, 1:28 p.m. OK MS C++ 2017 TESTS 18 109 409600 1400
56958873 kkeey C July 13, 2019, 5:48 a.m. OK MS C++ 2017 TESTS 18 109 2457600 1400
56581481 llolitay C July 5, 2019, 4:12 p.m. OK MS C++ 2017 TESTS 18 124 819200 1400
56624059 pmitkov C July 6, 2019, 1:03 p.m. OK MS C++ 2017 TESTS 18 124 1638400 1400
57893221 TianZuiXing C July 28, 2019, 12:35 p.m. OK MS C++ 2017 TESTS 18 124 1638400 1400
56587900 _Y_Y_ C July 5, 2019, 4:48 p.m. OK MS C++ 2017 TESTS 18 124 12083200 1400
56579275 renfei147 C July 5, 2019, 4:02 p.m. OK MS C++ 2017 TESTS 18 139 16076800 1400
56605080 Izeytee C July 6, 2019, 3:53 a.m. OK MS C++ 2017 TESTS 18 140 1638400 1400
56585002 xsd C July 5, 2019, 4:31 p.m. OK Ocaml TESTS 18 498 14028800 1400
56617201 mayakin C July 6, 2019, 10:16 a.m. OK PHP TESTS 18 482 10035200 1400
57986373 lostamok C July 30, 2019, 11:32 a.m. OK PHP TESTS 18 498 10035200 1400
56593313 hyta4982 C July 5, 2019, 6:14 p.m. OK PyPy 2 TESTS 18 156 12185600 1400
56591725 hyta4982 C July 5, 2019, 5:44 p.m. OK PyPy 2 TESTS 18 171 12083200 1400
56592390 minimalizam C July 5, 2019, 5:55 p.m. OK PyPy 2 TESTS 18 202 7577600 1400
56588972 raj1307 C July 5, 2019, 4:55 p.m. OK PyPy 2 TESTS 18 202 8704000 1400
59074486 yumtam C Aug. 19, 2019, 6:31 a.m. OK PyPy 2 TESTS 18 249 12083200 1400
56577762 thuutin C July 5, 2019, 3:55 p.m. OK PyPy 2 TESTS 18 405 15974400 1400
56993841 Quirinius C July 13, 2019, 8:11 p.m. OK PyPy 2 TESTS 18 1231 14233600 1400
56583018 Zeyu C July 5, 2019, 4:20 p.m. OK PyPy 2 TESTS 18 1341 6656000 1400
56575659 anshuman16423 C July 5, 2019, 3:47 p.m. OK PyPy 2 TESTS 18 1419 5427200 1400
56584253 oskarl C July 5, 2019, 4:27 p.m. OK PyPy 2 TESTS 18 1419 7987200 1400
56611340 dilesh.yadav.phe16 C July 6, 2019, 7:26 a.m. OK PyPy 3 TESTS 18 389 9830400 1400
56610416 dilesh.yadav.phe16 C July 6, 2019, 7:01 a.m. OK PyPy 3 TESTS 18 389 9830400 1400
57069848 Pokeylope C July 15, 2019, 1:53 a.m. OK PyPy 3 TESTS 18 404 10240000 1400
56713228 normalboot C July 8, 2019, 1:30 p.m. OK PyPy 3 TESTS 18 405 9728000 1400
56611449 dilesh.yadav.phe16 C July 6, 2019, 7:30 a.m. OK PyPy 3 TESTS 18 405 9830400 1400
57294880 chaudhary_19 C July 18, 2019, 6:41 p.m. OK PyPy 3 TESTS 18 405 10035200 1400
56607696 Akash_123 C July 6, 2019, 5:44 a.m. OK PyPy 3 TESTS 18 420 9728000 1400
57447566 Kadtsin_vs C July 21, 2019, 8:41 a.m. OK PyPy 3 TESTS 18 420 10547200 1400
68870932 vyassamir C Jan. 15, 2020, 3:10 p.m. OK PyPy 3 TESTS 18 421 10035200 1400
56581646 McCheng C July 5, 2019, 4:13 p.m. OK PyPy 3 TESTS 18 421 10137600 1400
56585055 daniel.carlos C July 5, 2019, 4:31 p.m. OK Python 2 TESTS 18 468 2048000 1400
56702855 CuteTN C July 8, 2019, 9:56 a.m. OK Python 2 TESTS 18 483 3481600 1400
56707113 Ex0d1a C July 8, 2019, 11:28 a.m. OK Python 2 TESTS 18 483 3993600 1400
56785218 SoSooding C July 10, 2019, 8:05 a.m. OK Python 2 TESTS 18 498 4198400 1400
56580122 ashu249 C July 5, 2019, 4:05 p.m. OK Python 2 TESTS 18 499 3481600 1400
65340447 Annvv C Nov. 19, 2019, 10:44 a.m. OK Python 3 TESTS 18 374 6144000 1400
57074466 the_white_devil C July 15, 2019, 4:23 a.m. OK Python 3 TESTS 18 452 6041600 1400
57294904 chaudhary_19 C July 18, 2019, 6:41 p.m. OK Python 3 TESTS 18 561 4198400 1400
57164829 erickjohnross C July 16, 2019, 9:35 p.m. OK Python 3 TESTS 18 561 4198400 1400
56605549 KanhuKeNanu C July 6, 2019, 4:19 a.m. OK Python 3 TESTS 18 561 4198400 1400
68359188 Pizz C Jan. 7, 2020, 1:24 p.m. OK Python 3 TESTS 18 561 6553600 1400
65339889 Annvv C Nov. 19, 2019, 10:32 a.m. OK Python 3 TESTS 18 592 4710400 1400
56632074 LintuStorm C July 6, 2019, 4:59 p.m. OK Python 3 TESTS 18 623 14848000 1400
56578313 HybridSkills C July 5, 2019, 3:57 p.m. OK Python 3 TESTS 18 654 9011200 1400
56590296 l_l_l C July 5, 2019, 5:03 p.m. OK Python 3 TESTS 18 655 6348800 1400
56600944 frozenlib C July 6, 2019, 12:10 a.m. OK Rust TESTS 18 31 1843200 1400
56600873 frozenlib C July 6, 2019, 12:05 a.m. OK Rust TESTS 18 61 2355200 1400
56587340 cympfh C July 5, 2019, 4:45 p.m. OK Rust TESTS 18 1060 4608000 1400

remove filters

Back to search problems