Codeforces Round 587 (Div. 3)

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
1216 Codeforces Round 587 (Div. 3) FINISHED False 7200 168389687 Sept. 21, 2019, 7:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2747 ) F Wi-Fi PROGRAMMING data structures dp greedy 2300

B"You work as a system administrator in a dormitory, which has n rooms one after another along a straight hallway. Rooms are numbered from 1 to n . You have to connect all n rooms to the Internet. You can connect each room to the Internet directly, the cost of such connection for the i -th room is i coins. Some rooms also have a spot for a router. The cost of placing a router in the i -th room is also i coins. You cannot place a router in a room which does not have a spot for it. When you place a router in the room i , you connect all rooms with the numbers from max(1,~i - k) to min(n,~i + k) inclusive to the Internet, where k is the range of router. The value of k is the same for all routers. Calculate the minimum total cost of connecting all n rooms to the Internet. You can assume that the number of rooms which have a spot for a router is not greater than the number of routers you have. The first line of the input contains two integers n and k ( 1 <= n, k <= 2 cdot 10^5 ) -- the number of rooms and the range of each router. The second line of the input contains one string s of length n , consisting only of zeros and ones. If the i -th character of the string equals to '1' then there is a spot for a router in the i -th room. If the i -th character of the string equals to '0' then you cannot place a router in the i -th room. Print one integer -- the minimum total cost of connecting all n rooms to the Internet. In the first example it is enough to place the router in the room 3 , then all rooms will be connected to the Internet. The total cost of connection is 3 . In the second example you can place routers nowhere, so you need to connect all rooms directly. Thus, the total cost of connection of all rooms is 1 + 2 + 3 + 4 + 5 + 6 = 21 . In the third example you need to connect the room 1 directly and "...

Tutorials

Codeforces Round #587 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
68023201 ChiNhan F Jan. 1, 2020, 2:33 a.m. OK GNU C++11 TESTS 55 31 1843200 2300
63208409 x_faraway_x F Oct. 23, 2019, 1:55 a.m. OK GNU C++11 TESTS 55 31 1843200 2300
61041441 beacon_cwk F Sept. 22, 2019, 12:50 a.m. OK GNU C++11 TESTS 55 31 1843200 2300
61245925 AutumnKite F Sept. 25, 2019, 12:03 a.m. OK GNU C++11 TESTS 55 31 2457600 2300
69838822 xyjw F Jan. 30, 2020, 12:35 p.m. OK GNU C++11 TESTS 55 31 2662400 2300
64675141 vjudge4 F Nov. 11, 2019, 7:43 a.m. OK GNU C++11 TESTS 55 31 2662400 2300
62204351 ygl666 F Oct. 9, 2019, 12:50 p.m. OK GNU C++11 TESTS 55 31 2662400 2300
61787329 Shinazo F Oct. 3, 2019, 2:49 p.m. OK GNU C++11 TESTS 55 31 2662400 2300
61452366 JKadirov F Sept. 29, 2019, 4:06 a.m. OK GNU C++11 TESTS 55 31 2662400 2300
61314929 CMZ F Sept. 26, 2019, 10:43 a.m. OK GNU C++11 TESTS 55 31 2662400 2300
61576010 DatoTS F Sept. 30, 2019, 8:52 p.m. OK GNU C++14 TESTS 55 30 3788800 2300
62620738 csgocsgo F Oct. 15, 2019, 12:47 p.m. OK GNU C++14 TESTS 55 30 5427200 2300
61194094 is_ffacs F Sept. 24, 2019, 4:38 a.m. OK GNU C++14 TESTS 55 31 1843200 2300
61202914 Computerbox_ F Sept. 24, 2019, 8:30 a.m. OK GNU C++14 TESTS 55 31 2150400 2300
69086653 vjudge2 F Jan. 19, 2020, 8:34 a.m. OK GNU C++14 TESTS 55 31 2662400 2300
61601804 gkftndlTek F Oct. 1, 2019, 11:16 a.m. OK GNU C++14 TESTS 55 31 2662400 2300
61459735 CitricAcid F Sept. 29, 2019, 8 a.m. OK GNU C++14 TESTS 55 31 2662400 2300
61422172 ashish14012000 F Sept. 28, 2019, 12:05 p.m. OK GNU C++14 TESTS 55 31 2662400 2300
61393184 _HossamYehia_ F Sept. 27, 2019, 11:34 p.m. OK GNU C++14 TESTS 55 31 2662400 2300
61200192 chen_nuo F Sept. 24, 2019, 7:26 a.m. OK GNU C++14 TESTS 55 31 2662400 2300
61461243 firevolt F Sept. 29, 2019, 8:38 a.m. OK GNU C++17 TESTS 55 30 3379200 2300
61106365 nickluo F Sept. 23, 2019, 9:23 a.m. OK GNU C++17 TESTS 55 30 4300800 2300
64507912 contrast F Nov. 8, 2019, 7:41 a.m. OK GNU C++17 TESTS 55 30 5427200 2300
64581770 HaydenMuscat F Nov. 9, 2019, 12:18 p.m. OK GNU C++17 TESTS 55 31 1843200 2300
61329160 Pi_Yuan_Yuan F Sept. 26, 2019, 2:30 p.m. OK GNU C++17 TESTS 55 31 1843200 2300
61110226 yeeeet F Sept. 23, 2019, 10:58 a.m. OK GNU C++17 TESTS 55 31 1843200 2300
61056295 fdironia F Sept. 22, 2019, 8:09 a.m. OK GNU C++17 TESTS 55 31 1843200 2300
61266029 buyolitsez F Sept. 25, 2019, 12:47 p.m. OK GNU C++17 TESTS 55 31 2150400 2300
61223051 ujjwalr0x F Sept. 24, 2019, 2:26 p.m. OK GNU C++17 TESTS 55 31 2150400 2300
60996257 dkj_23 F Sept. 21, 2019, 8:52 a.m. OK GNU C++17 TESTS 55 31 2150400 2300
61108988 pikapika00 F Sept. 23, 2019, 10:30 a.m. OK Java 8 TESTS 55 124 0 2300
61089875 Ahmad F Sept. 22, 2019, 8:34 p.m. OK Java 8 TESTS 55 124 0 2300
61034588 troll1999 F Sept. 21, 2019, 7:08 p.m. OK Java 8 TESTS 55 124 0 2300
61016121 KharYusuf F Sept. 21, 2019, 1:25 p.m. OK Java 8 TESTS 55 124 0 2300
61034296 derrick20 F Sept. 21, 2019, 7:01 p.m. OK Java 8 TESTS 55 139 0 2300
67315574 vktennis F Dec. 21, 2019, 5:50 a.m. OK Java 8 TESTS 55 170 2252800 2300
61007418 pratik98 F Sept. 21, 2019, 11:28 a.m. OK Java 8 TESTS 55 171 0 2300
61804703 icpc_loser F Oct. 3, 2019, 8:46 p.m. OK Java 8 TESTS 55 202 5324800 2300
61093211 ijxjdjd F Sept. 23, 2019, 12:04 a.m. OK Java 8 TESTS 55 248 0 2300
61023250 Ahmed_Diab F Sept. 21, 2019, 3:13 p.m. OK Java 8 TESTS 55 249 0 2300
61095946 Spheniscine F Sept. 23, 2019, 3:03 a.m. OK Kotlin TESTS 55 124 0 2300
61036597 Tlatoani F Sept. 21, 2019, 8:13 p.m. OK Kotlin TESTS 55 280 19968000 2300
62599498 og.kostya F Oct. 15, 2019, 4:33 a.m. OK Mono C# TESTS 55 93 5734400 2300
61264864 vjudge1 F Sept. 25, 2019, 12:30 p.m. OK MS C++ TESTS 55 31 1843200 2300
61218349 vjudge1 F Sept. 24, 2019, 1:19 p.m. OK MS C++ TESTS 55 31 2662400 2300
61096789 vjudge1 F Sept. 23, 2019, 3:49 a.m. OK MS C++ TESTS 55 31 5836800 2300
61343364 vjudge3 F Sept. 27, 2019, 1:45 a.m. OK MS C++ TESTS 55 31 12185600 2300
61343315 vjudge5 F Sept. 27, 2019, 1:39 a.m. OK MS C++ TESTS 55 46 10035200 2300
61110567 GU_GUGU F Sept. 23, 2019, 11:06 a.m. OK MS C++ 2017 TESTS 55 31 2969600 2300
61007837 CrashMaster F Sept. 21, 2019, 11:34 a.m. OK MS C++ 2017 TESTS 55 46 5427200 2300
61110477 AleksanderBalobanov F Sept. 23, 2019, 11:04 a.m. OK MS C++ 2017 TESTS 55 62 74137600 2300
61069962 typeryougishiki F Sept. 22, 2019, 12:23 p.m. OK MS C++ 2017 TESTS 55 77 8192000 2300
61111637 AleksanderBalobanov F Sept. 23, 2019, 11:29 a.m. OK MS C++ 2017 TESTS 55 78 123392000 2300
64055560 j3lly5tars F Nov. 2, 2019, 1:10 a.m. OK MS C++ 2017 TESTS 55 109 7680000 2300
64540878 vjudge5 F Nov. 8, 2019, 6:37 p.m. OK MS C++ 2017 TESTS 55 109 9420800 2300
64055589 vjudge5 F Nov. 2, 2019, 1:11 a.m. OK MS C++ 2017 TESTS 55 124 7680000 2300
64054983 j3lly5tars F Nov. 2, 2019, 12:46 a.m. OK MS C++ 2017 TESTS 55 124 10137600 2300
61827706 yuva_striker F Oct. 4, 2019, 5:29 a.m. OK MS C++ 2017 TESTS 55 156 16281600 2300
61039923 alexwice F Sept. 21, 2019, 10:51 p.m. OK PyPy 2 TESTS 55 186 13721600 2300
61068857 sam997 F Sept. 22, 2019, 11:59 a.m. OK PyPy 3 TESTS 55 186 15155200 2300
61157552 abhiram.k12345 F Sept. 23, 2019, 3:30 p.m. OK PyPy 3 TESTS 55 202 16281600 2300
61854757 vjudge5 F Oct. 4, 2019, 1:45 p.m. OK PyPy 3 TESTS 55 217 14643200 2300
61922596 Leendertz F Oct. 5, 2019, 1:45 p.m. OK PyPy 3 TESTS 55 233 17920000 2300
64274229 ivanzuki F Nov. 4, 2019, 8:27 p.m. OK PyPy 3 TESTS 55 265 17920000 2300
61353227 macleChen F Sept. 27, 2019, 9:20 a.m. OK PyPy 3 TESTS 55 312 25088000 2300
60995115 conqueror_of_tourist F Sept. 21, 2019, 8:47 a.m. OK PyPy 3 TESTS 55 436 22835200 2300
61083074 titia F Sept. 22, 2019, 5:10 p.m. OK PyPy 3 TESTS 55 545 17612800 2300
61230939 tjake F Sept. 24, 2019, 4:35 p.m. OK PyPy 3 TESTS 55 561 17408000 2300
61225138 neterukun F Sept. 24, 2019, 3 p.m. OK PyPy 3 TESTS 55 686 34713600 2300
61535308 Code_Bear F Sept. 30, 2019, 6:01 a.m. OK Python 3 TESTS 55 389 6246400 2300
62859827 genocid F Oct. 18, 2019, 10:26 a.m. OK Python 3 TESTS 55 389 10240000 2300
61009750 Gaurav1 F Sept. 21, 2019, 11:57 a.m. OK Python 3 TESTS 55 919 17203200 2300
61072130 ValenKof F Sept. 22, 2019, 1:09 p.m. OK Rust TESTS 55 31 3174400 2300
61043244 sansen F Sept. 22, 2019, 2:29 a.m. OK Rust TESTS 55 61 9728000 2300

remove filters

Back to search problems