Codeforces Round 709 (Div. 1, based on Technocup 2021 Final Round)

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
1483 Codeforces Round 709 (Div. 1, based on Technocup 2021 Final Round) FINISHED False 8100 120847163 March 21, 2021, 1:20 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 919 ) C Skyline Photo PROGRAMMING data structures dp

B'Alice is visiting New York City. To make the trip fun, Alice will take photos of the city skyline and give the set of photos as a present to Bob. However, she wants to find the set of photos with maximum beauty and she needs your help. There are n buildings in the city, the i -th of them has positive height h_i . All n building heights in the city are different. In addition, each building has a beauty value b_i . Note that beauty can be positive or negative, as there are ugly buildings in the city too. A set of photos consists of one or more photos of the buildings in the skyline. Each photo includes one or more buildings in the skyline that form a contiguous segment of indices. Each building needs to be in exactly one photo. This means that if a building does not appear in any photo, or if a building appears in more than one photo, the set of pictures is not valid. The beauty of a photo is equivalent to the beauty b_i of the shortest building in it. The total beauty of a set of photos is the sum of the beauty of all photos in it. Help Alice to find the maximum beauty a valid set of photos can have. The first line contains an integer n ( 1 <= n <= 3 cdot 10^5 ), the number of buildings on the skyline. The second line contains n distinct integers h_1, h_2, ldots, h_n ( 1 <= h_i <= n ). The i -th number represents the height of building i . The third line contains n integers b_1, b_2, ldots, b_n ( -10^9 <= b_i <= 10^9 ). The i -th number represents the beauty of building i . Print one number representing the maximum beauty Alice can achieve for a valid set of photos of the skyline. In the first example, Alice can achieve maximum beauty by taking five photos, each one containing one building. In the second example, Alice can achieve a maximum beauty of 10 by taking four pictures: three just containing one building, on buildings 1 , 2 '...

Tutorials

Technocup 2021: Final Round and Codeforces Round #709 — tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
110740709 fishcathu. C March 22, 2021, 1:45 p.m. OK GNU C++11 TESTS 43 46 8396800
110740406 fishcathu. C March 22, 2021, 1:42 p.m. OK GNU C++11 TESTS 43 46 8396800
110662095 2018LZY C March 21, 2021, 3:06 p.m. OK GNU C++11 TESTS 40 46 11980800
110741524 pipixia2019 C March 22, 2021, 1:55 p.m. OK GNU C++11 TESTS 43 46 12083200
110649545 fallleaves01 C March 21, 2021, 2:25 p.m. OK GNU C++11 TESTS 40 46 12083200
110777816 ___red___ C March 23, 2021, 2:47 a.m. OK GNU C++11 TESTS 43 46 14438400
110657733 Aurora7 C March 21, 2021, 2:51 p.m. OK GNU C++11 TESTS 40 46 14438400
110665104 szhlg C March 21, 2021, 3:17 p.m. OK GNU C++11 TESTS 40 46 16793600
110780057 bkifhr7 C March 23, 2021, 4:06 a.m. OK GNU C++11 TESTS 43 46 18022400
110780041 Fuko_Ibuki C March 23, 2021, 4:06 a.m. OK GNU C++11 TESTS 43 46 18022400
110634645 Daniel_yuan C March 21, 2021, 1:35 p.m. OK GNU C++14 TESTS 40 78 14233600
110763482 AgReB C March 22, 2021, 6:36 p.m. OK GNU C++14 TESTS 43 155 17510400
110645296 nhho C March 21, 2021, 2:12 p.m. OK GNU C++14 TESTS 40 171 2457600
110657760 kimjihoon C March 21, 2021, 2:51 p.m. OK GNU C++14 TESTS 40 171 4812800
110645271 _LNHTD_ C March 21, 2021, 2:11 p.m. OK GNU C++14 TESTS 40 171 4812800
110646787 smallling C March 21, 2021, 2:16 p.m. OK GNU C++14 TESTS 40 171 8396800
110657330 zhanggengchen C March 21, 2021, 2:50 p.m. OK GNU C++14 TESTS 40 171 9625600
110650643 Zayin C March 21, 2021, 2:28 p.m. OK GNU C++14 TESTS 40 171 18022400
110657690 isdvhb C March 21, 2021, 2:51 p.m. OK GNU C++14 TESTS 40 186 4812800
110678084 lucaperju C March 21, 2021, 6:07 p.m. OK GNU C++14 TESTS 42 187 12083200
110662687 allfadeaway C March 21, 2021, 3:08 p.m. OK GNU C++17 TESTS 40 77 15155200
110709625 windy7926778 C March 22, 2021, 7:44 a.m. OK GNU C++17 TESTS 43 140 11980800
110651399 natsugiri C March 21, 2021, 2:30 p.m. OK GNU C++17 TESTS 40 155 10854400
110654337 yukihana0416 C March 21, 2021, 2:39 p.m. OK GNU C++17 TESTS 40 155 30003200
110644451 zyb C March 21, 2021, 2:09 p.m. OK GNU C++17 TESTS 40 156 8396800
110655794 Cinque C March 21, 2021, 2:44 p.m. OK GNU C++17 TESTS 40 156 12083200
110661889 davidlee1999WTK C March 21, 2021, 3:05 p.m. OK GNU C++17 TESTS 40 170 8396800
110660879 ShadowLight C March 21, 2021, 3:02 p.m. OK GNU C++17 TESTS 40 171 7270400
110696082 Orenji.Sora C March 22, 2021, 3:54 a.m. OK GNU C++17 TESTS 43 171 9625600
110690859 trainwithoutpain C March 22, 2021, 12:49 a.m. OK GNU C++17 TESTS 43 171 9932800
110644883 yosupo C March 21, 2021, 2:10 p.m. OK GNU C++17 (64) TESTS 40 62 6041600
110646950 LayCurse C March 21, 2021, 2:16 p.m. OK GNU C++17 (64) TESTS 40 93 150016000
110655403 jell C March 21, 2021, 2:43 p.m. OK GNU C++17 (64) TESTS 40 109 2457600
110654493 Kude C March 21, 2021, 2:40 p.m. OK GNU C++17 (64) TESTS 40 109 4812800
110645719 Siberian C March 21, 2021, 2:13 p.m. OK GNU C++17 (64) TESTS 40 109 7270400
110690875 trainwithoutpain C March 22, 2021, 12:50 a.m. OK GNU C++17 (64) TESTS 43 109 9830400
110775211 1-gon C March 23, 2021, 12:51 a.m. OK GNU C++17 (64) TESTS 43 109 12697600
110650153 FieryPhoenix C March 21, 2021, 2:27 p.m. OK GNU C++17 (64) TESTS 40 124 2457600
110637078 never_giveup C March 21, 2021, 1:44 p.m. OK GNU C++17 (64) TESTS 40 124 2457600
110665925 Delfad0r C March 21, 2021, 3:20 p.m. OK GNU C++17 (64) TESTS 40 124 6041600
110660521 insert_cool_handle C March 21, 2021, 3 p.m. OK Java 11 TESTS 40 280 6656000
110668321 mikit C March 21, 2021, 3:28 p.m. OK Java 11 TESTS 40 373 9113600
110641334 uwi C March 21, 2021, 1:58 p.m. OK Java 11 TESTS 40 577 12800000
110687056 its_aks_ulure C March 21, 2021, 9:31 p.m. OK Java 11 TESTS 43 639 25907200
110673477 its_aks_ulure C March 21, 2021, 5 p.m. OK Java 11 TESTS 42 686 25907200
110651284 Discombobulated C March 21, 2021, 2:30 p.m. OK Java 11 TESTS 40 873 46080000
110660031 Justyo C March 21, 2021, 2:59 p.m. OK Java 11 TESTS 40 1560 24064000
110651263 fetetriste C March 21, 2021, 2:30 p.m. OK Java 8 TESTS 40 436 51404800
110707478 pulkit1411 C March 22, 2021, 7:13 a.m. OK Java 8 TESTS 43 499 45568000
110771239 2020akadaver C March 22, 2021, 9:27 p.m. OK Java 8 TESTS 43 514 54988800
110779210 hu_tao C March 23, 2021, 3:38 a.m. OK Java 8 TESTS 43 623 20070400
110651161 dalt C March 21, 2021, 2:30 p.m. OK Java 8 TESTS 40 841 63590400
110643896 Tlatoani C March 21, 2021, 2:07 p.m. OK Kotlin TESTS 40 592 23552000
110761814 arvindf232 C March 22, 2021, 6:12 p.m. OK Kotlin TESTS 43 1170 137318400
110673838 r57shell C March 21, 2021, 5:05 p.m. OK MS C++ TESTS 42 374 23859200
110655280 KADR C March 21, 2021, 2:43 p.m. OK MS C++ 2017 TESTS 40 202 57958400
110672319 a.stepanov281005 C March 21, 2021, 4:45 p.m. OK MS C++ 2017 TESTS 40 935 16793600
110686219 egordunaev C March 21, 2021, 8:49 p.m. OK MS C++ 2017 TESTS 43 935 43315200
110686289 egordunaev C March 21, 2021, 8:51 p.m. OK MS C++ 2017 TESTS 43 936 43315200
110674119 titia C March 21, 2021, 5:09 p.m. OK PyPy 3 TESTS 42 1808 61542400
110737908 toomer C March 22, 2021, 1:14 p.m. OK Rust TESTS 43 78 19251200
110675781 sansen C March 21, 2021, 5:33 p.m. OK Rust TESTS 42 93 35430400
110646776 sansen C March 21, 2021, 2:16 p.m. OK Rust TESTS 40 124 14438400
110655650 hiratai C March 21, 2021, 2:44 p.m. OK Rust TESTS 40 140 19865600
110652312 toomer C March 21, 2021, 2:33 p.m. OK Rust TESTS 40 280 32460800

remove filters

Back to search problems