Codeforces Round 557 (Div. 2) [based on Forethought Future Cup - 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
1162 Codeforces Round 557 (Div. 2) [based on Forethought Future Cup - Final Round] FINISHED False 7200 174833699 May 4, 2019, 5:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8281 ) A Zoning Restrictions Again PROGRAMMING implementation 800

B'You are planning to build housing on a street. There are n spots available on the street on which you can build a house. The spots are labeled from 1 to n from left to right. In each spot, you can build a house with an integer height between 0 and h . In each spot, if a house has height a , you will gain a^2 dollars from it. The city has m zoning restrictions. The i -th restriction says that the tallest house from spots l_i to r_i (inclusive) must be at most x_i . You would like to build houses to maximize your profit. Determine the maximum profit possible. The first line contains three integers n , h , and m ( 1 <= q n,h,m <= q 50 ) -- the number of spots, the maximum height, and the number of restrictions. Each of the next m lines contains three integers l_i , r_i , and x_i ( 1 <= q l_i <= q r_i <= q n , 0 <= q x_i <= q h ) -- left and right limits (inclusive) of the i -th restriction and the maximum possible height in that range. Print a single integer, the maximum profit you can make. In the first example, there are 3 houses, the maximum height of a house is 3 , and there are 3 restrictions. The first restriction says the tallest house between 1 and 1 must be at most 1 . The second restriction says the tallest house between 2 and 2 must be at most 3 . The third restriction says the tallest house between 3 and 3 must be at most 2 . In this case, it is optimal to build houses with heights [1, 3, 2] . This fits within all the restrictions. The total profit in this case is 1^2 + 3^2 + 2^2 = 14 . In the second example, there are 4 houses, the maximum height of a house is 10 , and there are 2 restrictions. The first restriction says the tallest house from 2 to 3 must be at most 8 . The second restriction says the tallest h'...

Tutorials

Forethought Future Cup Final Round Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
53848566 vjudge2 A May 7, 2019, 12:20 p.m. OK Clang++17 Diagnostics TESTS 29 46 0 800
54371617 shenqihao A May 19, 2019, 6:49 a.m. OK Clang++17 Diagnostics TESTS 29 46 0 800
59875484 Ghozlan A Sept. 1, 2019, 10:57 p.m. OK Clang++17 Diagnostics TESTS 29 46 0 800
53938421 moluren A May 10, 2019, 12:21 a.m. OK Clang++17 Diagnostics TESTS 29 46 0 800
53756413 A_IGOR A May 4, 2019, 6:15 p.m. OK Delphi TESTS 29 31 0 800
53813573 Denor A May 6, 2019, 8:42 a.m. OK Delphi TESTS 29 31 102400 800
53752392 Sainlaster A May 4, 2019, 5:40 p.m. OK Delphi TESTS 29 31 102400 800
53746614 ruban A May 4, 2019, 5:08 p.m. OK Delphi TESTS 29 31 80998400 800
54014448 pascalfans A May 12, 2019, 5:39 a.m. OK FPC TESTS 29 30 102400 800
63023534 duydec1 A Oct. 20, 2019, 3:26 p.m. OK FPC TESTS 29 31 0 800
61949040 luogu_bot5 A Oct. 6, 2019, 2:16 a.m. OK FPC TESTS 29 31 0 800
58795293 ghosthunterk A Aug. 14, 2019, 4:42 a.m. OK FPC TESTS 29 31 0 800
58071882 luogu_bot3 A July 31, 2019, 10:59 a.m. OK FPC TESTS 29 31 0 800
53751522 KpuBoHoruu_CoKoJI A May 4, 2019, 5:33 p.m. OK FPC TESTS 29 31 0 800
53749811 PAG A May 4, 2019, 5:22 p.m. OK FPC TESTS 29 31 0 800
53749084 ValdimirChim A May 4, 2019, 5:18 p.m. OK FPC TESTS 29 31 0 800
64789947 luogu_bot3 A Nov. 13, 2019, 10:47 a.m. OK FPC TESTS 29 31 102400 800
59502063 luogu_bot4 A Aug. 26, 2019, 3:31 a.m. OK FPC TESTS 29 31 102400 800
54480876 i_o__o_i A May 22, 2019, 10:59 a.m. OK GNU C11 TESTS 29 15 0 800
53750422 Nathuram A May 4, 2019, 5:26 p.m. OK GNU C11 TESTS 29 30 0 800
53751124 SaulSamano A May 4, 2019, 5:30 p.m. OK GNU C11 TESTS 29 30 0 800
53753777 rubber_duckieOwOwO A May 4, 2019, 5:51 p.m. OK GNU C11 TESTS 29 30 0 800
53794164 nahidulhemal123 A May 5, 2019, 2:30 p.m. OK GNU C11 TESTS 29 30 0 800
53802575 mohitsethia A May 5, 2019, 8:04 p.m. OK GNU C11 TESTS 29 30 0 800
53824758 Farhantarctic A May 6, 2019, 3:21 p.m. OK GNU C11 TESTS 29 30 0 800
54061950 _RibNat_ A May 13, 2019, 11:38 a.m. OK GNU C11 TESTS 29 30 0 800
54787767 ashk_21 A May 29, 2019, 5:17 a.m. OK GNU C11 TESTS 29 30 0 800
54887024 You_Know_Who A May 31, 2019, 5:57 p.m. OK GNU C11 TESTS 29 30 0 800
53796968 XTAIL A May 5, 2019, 3:50 p.m. OK GNU C++11 TESTS 29 15 0 800
53798031 Clockwise A May 5, 2019, 4:25 p.m. OK GNU C++11 TESTS 29 15 0 800
53853168 dc.fang A May 7, 2019, 2:30 p.m. OK GNU C++11 TESTS 29 15 0 800
53855457 vjudge2 A May 7, 2019, 3:53 p.m. OK GNU C++11 TESTS 29 15 0 800
53899239 CQUzbx A May 9, 2019, 8:08 a.m. OK GNU C++11 TESTS 29 15 0 800
54018487 luogu_bot2 A May 12, 2019, 8:15 a.m. OK GNU C++11 TESTS 29 15 0 800
54025661 rivercraft A May 12, 2019, 12:25 p.m. OK GNU C++11 TESTS 29 15 0 800
55319870 luogu_bot4 A June 9, 2019, 3:23 a.m. OK GNU C++11 TESTS 29 15 0 800
63554302 moaliborna1383 A Oct. 27, 2019, 12:27 p.m. OK GNU C++11 TESTS 29 15 0 800
68851577 AhmedOsama A Jan. 15, 2020, 9:08 a.m. OK GNU C++11 TESTS 29 15 0 800
62304933 prabu_29j99 A Oct. 10, 2019, 1:13 p.m. OK GNU C++14 TESTS 29 15 0 800
67978717 Mosharrof13 A Dec. 30, 2019, 6:08 p.m. OK GNU C++14 TESTS 29 15 0 800
66282677 twoplustwofive A Dec. 4, 2019, 5:54 p.m. OK GNU C++14 TESTS 29 15 0 800
65452540 short_circuit01 A Nov. 20, 2019, 6:44 p.m. OK GNU C++14 TESTS 29 15 0 800
64769805 xpov1LL A Nov. 12, 2019, 10:19 p.m. OK GNU C++14 TESTS 29 15 0 800
64697926 bhai.Shahab78612 A Nov. 11, 2019, 1:54 p.m. OK GNU C++14 TESTS 29 15 0 800
61432545 Naseem17 A Sept. 28, 2019, 3:16 p.m. OK GNU C++14 TESTS 29 15 0 800
60500003 jos_wll A Sept. 13, 2019, 6:12 p.m. OK GNU C++14 TESTS 29 15 0 800
59900298 Molukhyyeh A Sept. 2, 2019, 1:27 p.m. OK GNU C++14 TESTS 29 15 0 800
59853800 Mahmoud.Amin99 A Sept. 1, 2019, 12:42 p.m. OK GNU C++14 TESTS 29 15 0 800
60305661 purve20 A Sept. 9, 2019, 1:46 p.m. OK GNU C++17 TESTS 29 15 0 800
60848917 saynaaa A Sept. 19, 2019, 1:25 p.m. OK GNU C++17 TESTS 29 15 0 800
60927450 vjudge2 A Sept. 20, 2019, 12:42 p.m. OK GNU C++17 TESTS 29 15 0 800
61024774 mojtaba.jalambadani A Sept. 21, 2019, 3:40 p.m. OK GNU C++17 TESTS 29 15 0 800
61542540 SPyofgame A Sept. 30, 2019, 9:12 a.m. OK GNU C++17 TESTS 29 15 0 800
62115607 vladand A Oct. 8, 2019, 1:17 p.m. OK GNU C++17 TESTS 29 15 0 800
64095268 phambao73 A Nov. 2, 2019, 1:43 p.m. OK GNU C++17 TESTS 29 15 0 800
64548351 _Black_RM_Diamond_ A Nov. 8, 2019, 9:05 p.m. OK GNU C++17 TESTS 29 15 0 800
66362151 A-Safarkhon A Dec. 5, 2019, 6:16 p.m. OK GNU C++17 TESTS 29 15 0 800
67190085 anjgodara A Dec. 19, 2019, 6:42 a.m. OK GNU C++17 TESTS 29 15 0 800
54491378 tony_stark1 A May 22, 2019, 3:35 p.m. OK Go TESTS 29 31 0 800
54014248 shopnobaj_raju A May 12, 2019, 5:30 a.m. OK Go TESTS 29 31 0 800
53884153 mayank1601 A May 8, 2019, 4:52 p.m. OK Go TESTS 29 31 0 800
53883468 mayank1601 A May 8, 2019, 4:21 p.m. OK Go TESTS 29 31 0 800
53747482 caidodo0_0 A May 4, 2019, 5:11 p.m. OK Go TESTS 29 31 0 800
66520888 iliamoschkov77 A Dec. 8, 2019, 10:23 p.m. OK Java 11 TESTS 29 171 0 800
65465633 bluesky111 A Nov. 21, 2019, 5:43 a.m. OK Java 11 TESTS 29 171 0 800
69284546 o33202919 A Jan. 22, 2020, 7:33 a.m. OK Java 11 TESTS 29 202 0 800
54669610 golions A May 26, 2019, 3:30 p.m. OK Java 8 TESTS 29 108 0 800
53749887 NMouad21 A May 4, 2019, 5:23 p.m. OK Java 8 TESTS 29 108 0 800
53748834 shahdhairya678 A May 4, 2019, 5:17 p.m. OK Java 8 TESTS 29 108 0 800
53746757 serafimkoo A May 4, 2019, 5:09 p.m. OK Java 8 TESTS 29 108 0 800
62860110 vjudge2 A Oct. 18, 2019, 10:31 a.m. OK Java 8 TESTS 29 109 0 800
58861209 Dejokz A Aug. 15, 2019, 11:41 a.m. OK Java 8 TESTS 29 109 0 800
58096460 formalist A July 31, 2019, 8:09 p.m. OK Java 8 TESTS 29 109 0 800
56404219 MagentaCobra A July 1, 2019, 6:27 p.m. OK Java 8 TESTS 29 109 0 800
56296431 Ken_yagami A June 30, 2019, 6:15 a.m. OK Java 8 TESTS 29 109 0 800
55563595 Ahmed_Diab A June 14, 2019, 2:04 p.m. OK Java 8 TESTS 29 109 0 800
53871249 bumbleboo A May 8, 2019, 9:07 a.m. OK JavaScript TESTS 29 31 0 800
53983655 ken A May 11, 2019, 8:29 a.m. OK JavaScript TESTS 29 31 307200 800
53815156 I.A.K.O.V A May 6, 2019, 9:49 a.m. OK Kotlin TESTS 29 124 0 800
56185416 Spheniscine A June 28, 2019, 4:20 a.m. OK Kotlin TESTS 29 139 102400 800
69450077 tuanio A Jan. 24, 2020, 5:45 a.m. OK Kotlin TESTS 29 140 102400 800
60161693 rego97 A Sept. 6, 2019, 9:14 a.m. OK Kotlin TESTS 29 140 102400 800
56868398 mendel_vv A July 12, 2019, 4:59 a.m. OK Kotlin TESTS 29 140 102400 800
54891686 fc-lib-xyz A May 31, 2019, 8:57 p.m. OK Kotlin TESTS 29 140 102400 800
54216118 alykov A May 15, 2019, 9:39 p.m. OK Kotlin TESTS 29 155 0 800
59952252 aman36 A Sept. 3, 2019, 2:54 p.m. OK Kotlin TESTS 29 155 512000 800
55685150 og.kostya A June 17, 2019, 3:06 p.m. OK Mono C# TESTS 29 46 0 800
60299295 we1cometo A Sept. 9, 2019, 11:33 a.m. OK Mono C# TESTS 29 46 0 800
53819896 TRR A May 6, 2019, 12:36 p.m. OK Mono C# TESTS 29 46 0 800
53810567 Salatik231166 A May 6, 2019, 6:20 a.m. OK Mono C# TESTS 29 46 0 800
53752308 Bombazok A May 4, 2019, 5:39 p.m. OK Mono C# TESTS 29 46 0 800
53750211 King_of_nothing A May 4, 2019, 5:25 p.m. OK Mono C# TESTS 29 46 0 800
53747083 eki A May 4, 2019, 5:10 p.m. OK Mono C# TESTS 29 46 0 800
54262005 GusztavSzmolik A May 17, 2019, 2:45 a.m. OK Mono C# TESTS 29 62 0 800
53753072 ansergeyg A May 4, 2019, 5:45 p.m. OK Mono C# TESTS 29 62 0 800
53753117 mban259 A May 4, 2019, 5:45 p.m. OK Mono C# TESTS 29 62 0 800
61191545 vjudge2 A Sept. 24, 2019, 3:03 a.m. OK MS C++ TESTS 29 15 0 800
53978529 vjudge3 A May 11, 2019, 5:49 a.m. OK MS C++ TESTS 29 30 0 800
53897953 vjudge1 A May 9, 2019, 7:20 a.m. OK MS C++ TESTS 29 30 0 800
55017823 vjudge1 A June 3, 2019, 1:15 p.m. OK MS C++ TESTS 29 30 0 800
56368332 vjudge5 A July 1, 2019, 1:33 a.m. OK MS C++ TESTS 29 30 0 800
60920074 vjudge4 A Sept. 20, 2019, 10:14 a.m. OK MS C++ TESTS 29 30 0 800
61095779 vjudge3 A Sept. 23, 2019, 2:52 a.m. OK MS C++ TESTS 29 30 0 800
64498245 vjudge3 A Nov. 8, 2019, 2:06 a.m. OK MS C++ TESTS 29 30 0 800
64630008 vjudge3 A Nov. 10, 2019, 9:50 a.m. OK MS C++ TESTS 29 30 0 800
64884958 vjudge5 A Nov. 14, 2019, 12:49 p.m. OK MS C++ TESTS 29 30 0 800
61202755 vjudge3 A Sept. 24, 2019, 8:27 a.m. OK MS C++ 2017 TESTS 29 30 0 800
53867696 ag602326 A May 8, 2019, 5:46 a.m. OK MS C++ 2017 TESTS 29 30 0 800
54088409 hankJIN A May 14, 2019, 8:56 a.m. OK MS C++ 2017 TESTS 29 30 0 800
54982810 Atlasmoth A June 2, 2019, 2:03 p.m. OK MS C++ 2017 TESTS 29 30 0 800
53808033 Lordxx A May 6, 2019, 3:31 a.m. OK MS C++ 2017 TESTS 29 30 0 800
53746794 youx A May 4, 2019, 5:09 p.m. OK MS C++ 2017 TESTS 29 30 0 800
53750152 max4tim A May 4, 2019, 5:24 p.m. OK MS C++ 2017 TESTS 29 30 0 800
66054110 mpoleg A Nov. 30, 2019, 6:49 p.m. OK MS C++ 2017 TESTS 29 31 0 800
66423507 Tangerine A Dec. 6, 2019, 8 p.m. OK MS C++ 2017 TESTS 29 31 0 800
68711017 JuicyCloud12609 A Jan. 13, 2020, 12:59 p.m. OK MS C++ 2017 TESTS 29 31 0 800
53747552 Darooha A May 4, 2019, 5:11 p.m. OK Ocaml TESTS 29 15 0 800
56152580 Gimber A June 27, 2019, 8:45 a.m. OK PascalABC.NET TESTS 29 187 0 800
53790047 28Nik A May 5, 2019, 12:19 p.m. OK PascalABC.NET TESTS 29 187 0 800
53948825 ProVolodya A May 10, 2019, 8:22 a.m. OK PascalABC.NET TESTS 29 296 0 800
68999625 Nidavellir A Jan. 17, 2020, 6:57 p.m. OK PascalABC.NET TESTS 29 296 102400 800
53805606 mm944 A May 6, 2019, 12:11 a.m. OK PascalABC.NET TESTS 29 342 102400 800
54089553 rifqifatih A May 14, 2019, 9:54 a.m. OK PHP TESTS 29 46 0 800
53814629 lostamok A May 6, 2019, 9:26 a.m. OK PHP TESTS 29 46 0 800
54070830 gregvernon A May 13, 2019, 4:09 p.m. OK PHP TESTS 29 46 512000 800
54089413 rifqifatih A May 14, 2019, 9:45 a.m. OK PHP TESTS 29 46 512000 800
55506212 mayakin A June 12, 2019, 6:02 p.m. OK PHP TESTS 29 46 512000 800
53746932 pedrosorio A May 4, 2019, 5:09 p.m. OK PyPy 2 TESTS 29 124 0 800
54660665 badSHAH xennygrimmato A May 26, 2019, 10:39 a.m. OK PyPy 2 TESTS 29 124 0 800
54245390 allonsy_kim A May 16, 2019, 2:40 p.m. OK PyPy 2 TESTS 29 124 0 800
54169212 kaif_7 A May 15, 2019, 10:08 a.m. OK PyPy 2 TESTS 29 124 0 800
53764764 c1729 A May 4, 2019, 10:03 p.m. OK PyPy 2 TESTS 29 124 0 800
53750774 kbagoli1999 A May 4, 2019, 5:28 p.m. OK PyPy 2 TESTS 29 124 0 800
53751993 raj1307 A May 4, 2019, 5:37 p.m. OK PyPy 2 TESTS 29 139 0 800
55552598 Quirinius A June 14, 2019, 8:03 a.m. OK PyPy 2 TESTS 29 139 921600 800
53750695 daniel.carlos A May 4, 2019, 5:27 p.m. OK PyPy 2 TESTS 29 140 0 800
53748167 Mukundan314 A May 4, 2019, 5:14 p.m. OK PyPy 2 TESTS 29 140 0 800
53750025 Guvi_Aggy A May 4, 2019, 5:23 p.m. OK PyPy 3 TESTS 29 124 0 800
55109603 Zuizehongquaunha A June 5, 2019, 5:28 a.m. OK PyPy 3 TESTS 29 124 0 800
54395507 gaurav007_ A May 19, 2019, 7:42 p.m. OK PyPy 3 TESTS 29 124 0 800
53799667 toxzi A May 5, 2019, 5:41 p.m. OK PyPy 3 TESTS 29 124 0 800
53799861 toxzi A May 5, 2019, 5:49 p.m. OK PyPy 3 TESTS 29 124 307200 800
68619664 pinjgia A Jan. 11, 2020, 6:58 p.m. OK PyPy 3 TESTS 29 139 0 800
59548497 galim665 A Aug. 27, 2019, 12:42 a.m. OK PyPy 3 TESTS 29 139 0 800
55101554 deadguy A June 4, 2019, 8:42 p.m. OK PyPy 3 TESTS 29 139 0 800
54856187 ragnar7 A May 30, 2019, 7:41 p.m. OK PyPy 3 TESTS 29 139 0 800
54378427 kdao A May 19, 2019, 9:48 a.m. OK PyPy 3 TESTS 29 139 0 800
53881722 davidzhou A May 8, 2019, 3:10 p.m. OK Python 2 TESTS 29 156 0 800
54161518 hardy2106 A May 15, 2019, 6:46 a.m. OK Python 2 TESTS 29 170 0 800
53949863 29029 A May 10, 2019, 8:57 a.m. OK Python 2 TESTS 29 171 0 800
56016570 FikiCar A June 24, 2019, 9:46 p.m. OK Python 2 TESTS 29 171 0 800
54703559 wangguanyuan A May 27, 2019, 2:55 a.m. OK Python 2 TESTS 29 171 0 800
54374763 mgor A May 19, 2019, 8:18 a.m. OK Python 2 TESTS 29 171 0 800
53844675 franckmy A May 7, 2019, 10:03 a.m. OK Python 2 TESTS 29 171 0 800
53781901 thelastjedi A May 5, 2019, 9:12 a.m. OK Python 2 TESTS 29 171 0 800
53754178 quirinoflavio A May 4, 2019, 5:54 p.m. OK Python 2 TESTS 29 171 0 800
53748909 kipply A May 4, 2019, 5:18 p.m. OK Python 2 TESTS 29 171 0 800
54018069 Arhimason A May 12, 2019, 8:02 a.m. OK Python 3 TESTS 29 93 0 800
53791719 junior08 A May 5, 2019, 1:13 p.m. OK Python 3 TESTS 29 93 0 800
54872418 LuckT A May 31, 2019, 9:59 a.m. OK Python 3 TESTS 29 93 0 800
54869937 Aidos A May 31, 2019, 8:37 a.m. OK Python 3 TESTS 29 108 0 800
54795670 kopok2 A May 29, 2019, 9:28 a.m. OK Python 3 TESTS 29 108 0 800
54703887 wangguanyuan A May 27, 2019, 3:13 a.m. OK Python 3 TESTS 29 108 0 800
54140075 BlurryFaceGG A May 14, 2019, 5:18 p.m. OK Python 3 TESTS 29 108 0 800
54070987 ulyss A May 13, 2019, 4:14 p.m. OK Python 3 TESTS 29 108 0 800
55276479 benz_ A June 7, 2019, 7:29 p.m. OK Python 3 TESTS 29 108 0 800
54973675 tamchihang A June 2, 2019, 9:44 a.m. OK Python 3 TESTS 29 108 0 800
53749333 rinzu A May 4, 2019, 5:20 p.m. OK Ruby TESTS 29 61 0 800
66997790 fshuto A Dec. 16, 2019, 3:30 a.m. OK Ruby TESTS 29 93 0 800
65511688 megachuhancer A Nov. 22, 2019, 4:24 a.m. OK Ruby TESTS 29 93 204800 800
54716484 sash0 A May 27, 2019, 1:36 p.m. OK Rust TESTS 29 31 0 800
53749710 Budstalion A May 4, 2019, 5:22 p.m. OK Scala TESTS 29 514 307200 800

remove filters

Back to search problems