Codeforces Round 570 (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
1183 Codeforces Round 570 (Div. 3) FINISHED False 8100 170263499 June 26, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18564 ) B Equalize Prices PROGRAMMING math 1000

B'There are n products in the shop. The price of the i -th product is a_i . The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly. In fact, the owner of the shop can change the price of some product i in such a way that the difference between the old price of this product a_i and the new price b_i is at most k . In other words, the condition |a_i - b_i| <= k should be satisfied ( |x| is the absolute value of x ). He can change the price for each product not more than once. Note that he can leave the old prices for some products. The new price b_i of each product i should be positive (i.e. b_i > 0 should be satisfied for all i from 1 to n ). Your task is to find out the maximum possible equal price B of all productts with the restriction that for all products the condiion |a_i - B| <= k should be satisfied (where a_i is the old price of the product and B is the same new price of all products) or report that it is impossible to find such price B . Note that the chosen price B should be integer. You should answer q independent queries. The first line of the input contains one integer q ( 1 <= q <= 100 ) -- the number of queries. Each query is presented by two lines. The first line of the query contains two integers n and k ( 1 <= n <= 100, 1 <= k <= 10^8 ) -- the number of products and the value k . The second line of the query contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^8 ), where a_i is the price of the i -th product. Print q integers, where the i -th integer is the answer B on the i -th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition |a_i - B| <= k should be satisfied (where a_i is th'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56151990 shenqihao B June 27, 2019, 8:31 a.m. OK Clang++17 Diagnostics TESTS 19 77 0 1000
56886553 Snigdha02 B July 12, 2019, 12:51 p.m. OK Clang++17 Diagnostics TESTS 19 77 7372800 1000
56688482 vjudge2 B July 8, 2019, 1:46 a.m. OK Clang++17 Diagnostics TESTS 19 93 0 1000
66552349 kien05012006 B Dec. 9, 2019, 3:23 p.m. OK FPC TESTS 19 31 0 1000
56162193 Bear.-. B June 27, 2019, 12:47 p.m. OK FPC TESTS 19 31 0 1000
56252998 Zeatea B June 29, 2019, 4:46 a.m. OK FPC TESTS 19 31 0 1000
56740315 Meibisu B July 9, 2019, 7:23 a.m. OK FPC TESTS 19 31 0 1000
56170847 bin9638 B June 27, 2019, 4:28 p.m. OK FPC TESTS 19 31 102400 1000
66526661 canhtoanPASCAL B Dec. 9, 2019, 5:18 a.m. OK FPC TESTS 19 31 102400 1000
67301664 canhtoana2k23 B Dec. 20, 2019, 6:59 p.m. OK FPC TESTS 19 31 102400 1000
57171354 zyenz123 B July 17, 2019, 3:15 a.m. OK FPC TESTS 19 46 0 1000
56232680 MHHasan B June 28, 2019, 2:51 p.m. OK GNU C11 TESTS 19 30 0 1000
57834168 Bubamara1313 B July 27, 2019, 7 a.m. OK GNU C11 TESTS 19 30 0 1000
57588367 the_anomaly B July 23, 2019, 11:28 a.m. OK GNU C11 TESTS 19 30 0 1000
57256073 mominrafiq B July 18, 2019, 2:31 a.m. OK GNU C11 TESTS 19 30 0 1000
57128441 SaadNoor555 B July 16, 2019, 5:59 a.m. OK GNU C11 TESTS 19 30 0 1000
65890676 mth1908 B Nov. 28, 2019, 3:05 a.m. OK GNU C11 TESTS 19 30 0 1000
56175102 RitikBaid B June 27, 2019, 6:39 p.m. OK GNU C11 TESTS 19 30 0 1000
65688742 mth1908 B Nov. 25, 2019, 2:53 a.m. OK GNU C11 TESTS 19 31 0 1000
65688673 mth1908 B Nov. 25, 2019, 2:49 a.m. OK GNU C11 TESTS 19 31 0 1000
66046345 von-Neumann B Nov. 30, 2019, 3:14 p.m. OK GNU C11 TESTS 19 31 0 1000
56224127 vjudge3 B June 28, 2019, 11:13 a.m. OK GNU C++11 TESTS 19 15 0 1000
56176268 lzytourist B June 27, 2019, 7:20 p.m. OK GNU C++11 TESTS 19 15 0 1000
56533729 IceLady B July 4, 2019, 9:52 p.m. OK GNU C++11 TESTS 19 15 0 1000
57254952 vjudge3 B July 18, 2019, 2:01 a.m. OK GNU C++11 TESTS 19 15 0 1000
58482644 ThoseBygones B Aug. 9, 2019, 6:20 a.m. OK GNU C++11 TESTS 19 15 0 1000
64203569 scimoon B Nov. 4, 2019, 12:11 p.m. OK GNU C++11 TESTS 19 15 0 1000
64203578 luogu_bot2 B Nov. 4, 2019, 12:11 p.m. OK GNU C++11 TESTS 19 15 0 1000
64305912 luogu_bot1 B Nov. 5, 2019, 11:26 a.m. OK GNU C++11 TESTS 19 15 0 1000
64306087 luogu_bot5 B Nov. 5, 2019, 11:28 a.m. OK GNU C++11 TESTS 19 15 0 1000
65827902 ec-chenfinal B Nov. 27, 2019, 1:15 p.m. OK GNU C++11 TESTS 19 30 0 1000
68747927 dapu81000 B Jan. 14, 2020, 5:33 a.m. OK GNU C++14 TESTS 19 15 0 1000
69466988 nagooba B Jan. 24, 2020, 1:15 p.m. OK GNU C++14 TESTS 19 15 0 1000
68645498 Scut82 B Jan. 12, 2020, 8:56 a.m. OK GNU C++14 TESTS 19 15 0 1000
67668686 CoderAnshu B Dec. 26, 2019, 7:04 p.m. OK GNU C++14 TESTS 19 15 0 1000
66590081 abhinavvv306 B Dec. 10, 2019, 12:41 p.m. OK GNU C++14 TESTS 19 15 0 1000
65413314 vjudge3 B Nov. 20, 2019, 5:36 a.m. OK GNU C++14 TESTS 19 15 0 1000
64894144 kkdrummer B Nov. 14, 2019, 3:52 p.m. OK GNU C++14 TESTS 19 15 0 1000
62925163 rafiul_akon B Oct. 19, 2019, 11:08 a.m. OK GNU C++14 TESTS 19 15 0 1000
62099683 Legendary_Expert B Oct. 8, 2019, 8:43 a.m. OK GNU C++14 TESTS 19 15 0 1000
62209672 nikhil_5128 B Oct. 9, 2019, 2:08 p.m. OK GNU C++14 TESTS 19 15 0 1000
69527759 rubai_99 B Jan. 25, 2020, 3:46 p.m. OK GNU C++17 TESTS 19 15 0 1000
69062245 prithvianilk B Jan. 18, 2020, 5:02 p.m. OK GNU C++17 TESTS 19 15 0 1000
68842351 KR1shna B Jan. 15, 2020, 6:15 a.m. OK GNU C++17 TESTS 19 15 0 1000
68680028 voidcs B Jan. 12, 2020, 9:05 p.m. OK GNU C++17 TESTS 19 15 0 1000
68423947 vjudge4 B Jan. 9, 2020, 1:31 a.m. OK GNU C++17 TESTS 19 15 0 1000
68056860 juniorcompressor B Jan. 1, 2020, 11:48 p.m. OK GNU C++17 TESTS 19 15 0 1000
68039849 Jabaiy_Mysyq B Jan. 1, 2020, 1:48 p.m. OK GNU C++17 TESTS 19 15 0 1000
67683573 Sonechko B Dec. 27, 2019, 7:43 a.m. OK GNU C++17 TESTS 19 15 0 1000
66435008 timothyhorsc B Dec. 7, 2019, 5:44 a.m. OK GNU C++17 TESTS 19 15 0 1000
65702605 vjudge3 B Nov. 25, 2019, 11:22 a.m. OK GNU C++17 TESTS 19 15 0 1000
57903699 vchilikov B July 28, 2019, 4:44 p.m. OK Go TESTS 19 280 0 1000
57121314 XYRain B July 16, 2019, 1:20 a.m. OK Go TESTS 19 280 0 1000
56552155 suryanshv23 B July 5, 2019, 10:19 a.m. OK Go TESTS 19 280 0 1000
56282173 anonimoper B June 29, 2019, 5:27 p.m. OK Go TESTS 19 280 0 1000
56154365 LuuNhatPhi B June 27, 2019, 9:32 a.m. OK Go TESTS 19 280 0 1000
58239381 LeoRiether B Aug. 3, 2019, 10:24 p.m. OK Go TESTS 19 295 0 1000
56732064 guoruihan B July 9, 2019, 2:13 a.m. OK Go TESTS 19 296 0 1000
57763004 shapovalex B July 25, 2019, 6:47 p.m. OK Go TESTS 19 312 0 1000
57708778 jmazon B July 24, 2019, 9:58 p.m. OK Haskell TESTS 19 46 102400 1000
56167905 mredigonda B June 27, 2019, 3:06 p.m. OK Haskell TESTS 19 62 102400 1000
69010319 warrioramrit B Jan. 18, 2020, 3:07 a.m. OK Java 11 TESTS 19 171 0 1000
66663439 satya_p54 B Dec. 12, 2019, 5:54 a.m. OK Java 11 TESTS 19 171 0 1000
66435040 al_Jahy B Dec. 7, 2019, 5:45 a.m. OK Java 11 TESTS 19 187 0 1000
69018194 Yossef B Jan. 18, 2020, 5:50 a.m. OK Java 11 TESTS 19 202 0 1000
69937603 khyatiagrawal19 B Feb. 1, 2020, 4:47 a.m. OK Java 11 TESTS 19 218 0 1000
69904955 soumitri12 B Jan. 31, 2020, 1:55 p.m. OK Java 11 TESTS 19 218 0 1000
69508119 Jainam_Sanghvi B Jan. 25, 2020, 9:29 a.m. OK Java 11 TESTS 19 218 0 1000
69219975 Younoknowme B Jan. 21, 2020, 3:54 a.m. OK Java 11 TESTS 19 233 0 1000
57605730 empirico91 B July 23, 2019, 5:48 p.m. OK Java 8 TESTS 19 108 0 1000
65929820 Blastman B Nov. 28, 2019, 8:16 p.m. OK Java 8 TESTS 19 109 0 1000
64520883 Keyur21 B Nov. 8, 2019, 12:17 p.m. OK Java 8 TESTS 19 109 0 1000
61359422 applemelon B Sept. 27, 2019, 11:39 a.m. OK Java 8 TESTS 19 109 0 1000
59810241 67697591 B Aug. 31, 2019, 1:22 p.m. OK Java 8 TESTS 19 109 0 1000
59390850 Vaibhav_Domadia B Aug. 24, 2019, 8:27 a.m. OK Java 8 TESTS 19 109 0 1000
58977802 AhmadEyad B Aug. 18, 2019, 2:12 a.m. OK Java 8 TESTS 19 109 0 1000
58879955 LeamyCodes B Aug. 15, 2019, 8:13 p.m. OK Java 8 TESTS 19 109 0 1000
58341702 MahmoudJobeel B Aug. 5, 2019, 1:26 p.m. OK Java 8 TESTS 19 109 0 1000
58153883 that_anxious_shy_kid B Aug. 2, 2019, 4:26 a.m. OK Java 8 TESTS 19 109 0 1000
58052553 arboreal B July 31, 2019, 3:15 a.m. OK JavaScript TESTS 19 31 1433600 1000
56511197 I.A.K.O.V B July 4, 2019, 10:28 a.m. OK Kotlin TESTS 19 109 0 1000
57568741 Killer45 B July 23, 2019, 4:16 a.m. OK Kotlin TESTS 19 124 0 1000
56511040 I.A.K.O.V B July 4, 2019, 10:23 a.m. OK Kotlin TESTS 19 124 0 1000
56450212 stepanovep B July 2, 2019, 9:31 p.m. OK Kotlin TESTS 19 140 409600 1000
56856682 MattM B July 11, 2019, 6:52 p.m. OK Kotlin TESTS 19 155 204800 1000
56470874 harryoooooooooo B July 3, 2019, 11:03 a.m. OK Kotlin TESTS 19 155 204800 1000
56185956 Spheniscine B June 28, 2019, 4:46 a.m. OK Kotlin TESTS 19 155 204800 1000
56225320 ScanNorOne B June 28, 2019, 11:59 a.m. OK Kotlin TESTS 19 156 204800 1000
56494535 mendel_vv B July 4, 2019, 1:54 a.m. OK Kotlin TESTS 19 171 204800 1000
56181393 sashamc B June 28, 2019, 12:02 a.m. OK Kotlin TESTS 19 186 1228800 1000
56191057 TRR B June 28, 2019, 7:38 a.m. OK Mono C# TESTS 19 46 1228800 1000
56422915 treasuryonly B July 2, 2019, 8:13 a.m. OK Mono C# TESTS 19 61 1228800 1000
56528232 ds88 B July 4, 2019, 6:15 p.m. OK Mono C# TESTS 19 62 1126400 1000
59103550 ansergeyg B Aug. 19, 2019, 5:04 p.m. OK Mono C# TESTS 19 62 1228800 1000
63097784 m1_k3 B Oct. 21, 2019, 9:35 p.m. OK Mono C# TESTS 19 62 3686400 1000
56472347 maxkh B July 3, 2019, 11:42 a.m. OK Mono C# TESTS 19 62 4812800 1000
62057422 nadilk B Oct. 7, 2019, 12:33 p.m. OK Mono C# TESTS 19 77 4915200 1000
66165628 tomomo2b2 B Dec. 2, 2019, 7:26 a.m. OK Mono C# TESTS 19 77 4915200 1000
56597573 zazak B July 5, 2019, 8:31 p.m. OK Mono C# TESTS 19 77 4915200 1000
56548936 NEvOl B July 5, 2019, 8:51 a.m. OK Mono C# TESTS 19 93 4915200 1000
57185087 vjudge4 B July 17, 2019, 8:26 a.m. OK MS C++ TESTS 19 15 0 1000
57081673 vjudge4 B July 15, 2019, 7:26 a.m. OK MS C++ TESTS 19 30 0 1000
57185081 vjudge1 B July 17, 2019, 8:26 a.m. OK MS C++ TESTS 19 30 0 1000
57189317 vjudge2 B July 17, 2019, 9:52 a.m. OK MS C++ TESTS 19 30 0 1000
57266835 vjudge3 B July 18, 2019, 7:28 a.m. OK MS C++ TESTS 19 30 0 1000
65415523 vjudge3 B Nov. 20, 2019, 6:42 a.m. OK MS C++ TESTS 19 30 0 1000
69814698 vjudge4 B Jan. 30, 2020, 5:44 a.m. OK MS C++ TESTS 19 30 0 1000
68423791 vjudge3 B Jan. 9, 2020, 1:23 a.m. OK MS C++ TESTS 19 30 0 1000
56847258 Merlin B July 11, 2019, 2:05 p.m. OK MS C++ TESTS 19 30 0 1000
65415593 vjudge2 B Nov. 20, 2019, 6:44 a.m. OK MS C++ TESTS 19 30 0 1000
69810233 vjudge2 B Jan. 30, 2020, 4:03 a.m. OK MS C++ 2017 TESTS 19 30 0 1000
65531042 Salty_Tears B Nov. 22, 2019, 12:27 p.m. OK MS C++ 2017 TESTS 19 30 0 1000
58987944 khangDang07 B Aug. 18, 2019, 7:56 a.m. OK MS C++ 2017 TESTS 19 30 0 1000
57174052 vjudge1 B July 17, 2019, 4:44 a.m. OK MS C++ 2017 TESTS 19 30 0 1000
56306076 alina_bulkina B June 30, 2019, 11:52 a.m. OK MS C++ 2017 TESTS 19 30 0 1000
56190301 wish1lucky B June 28, 2019, 7:10 a.m. OK MS C++ 2017 TESTS 19 30 0 1000
65416150 vjudge1 B Nov. 20, 2019, 6:57 a.m. OK MS C++ 2017 TESTS 19 31 0 1000
68408256 Nax_Motevich B Jan. 8, 2020, 3:53 p.m. OK MS C++ 2017 TESTS 19 31 0 1000
69275358 suun B Jan. 22, 2020, 1:34 a.m. OK MS C++ 2017 TESTS 19 31 0 1000
69809042 vjudge5 B Jan. 30, 2020, 3:29 a.m. OK MS C++ 2017 TESTS 19 31 0 1000
56245154 lukermelesh B June 28, 2019, 8:36 p.m. OK Node.js TESTS 19 170 2048000 1000
56224458 somsom12 B June 28, 2019, 11:27 a.m. OK PascalABC.NET TESTS 19 296 102400 1000
56399009 eg322 B July 1, 2019, 3:58 p.m. OK PascalABC.NET TESTS 19 326 102400 1000
57789005 Necrobine B July 26, 2019, 8:49 a.m. OK PascalABC.NET TESTS 19 560 204800 1000
56695793 PavelSmirnov B July 8, 2019, 6:56 a.m. OK PHP TESTS 19 31 409600 1000
58625283 ssk497 B Aug. 11, 2019, 5:12 p.m. OK PyPy 2 TESTS 19 124 204800 1000
56550138 bertrandovide B July 5, 2019, 9:21 a.m. OK PyPy 2 TESTS 19 124 204800 1000
56522747 frostD B July 4, 2019, 3:42 p.m. OK PyPy 2 TESTS 19 124 204800 1000
56853953 jolt.tks B July 11, 2019, 5:16 p.m. OK PyPy 2 TESTS 19 124 307200 1000
56624459 smunjal96 B July 6, 2019, 1:13 p.m. OK PyPy 2 TESTS 19 139 204800 1000
56405743 oskarl B July 1, 2019, 7:16 p.m. OK PyPy 2 TESTS 19 139 204800 1000
57344039 GTrigger B July 19, 2019, 8:58 p.m. OK PyPy 2 TESTS 19 139 409600 1000
57912582 -Morass- B July 28, 2019, 9:31 p.m. OK PyPy 2 TESTS 19 139 614400 1000
56531623 satyam_jindal B July 4, 2019, 8:07 p.m. OK PyPy 3 TESTS 19 140 1536000 1000
69879700 Deepanshu101 B Jan. 31, 2020, 5:51 a.m. OK PyPy 3 TESTS 19 140 1638400 1000
58502926 139pavlusha B Aug. 9, 2019, 3:05 p.m. OK PyPy 3 TESTS 19 140 1638400 1000
57101765 iamkevinhuang stevenrowantio YabelAurelius B July 15, 2019, 2:01 p.m. OK PyPy 3 TESTS 19 140 1638400 1000
58079799 tipra2614 B July 31, 2019, 1:33 p.m. OK PyPy 3 TESTS 19 140 1945600 1000
56655623 Dage233 B July 7, 2019, 8:35 a.m. OK PyPy 3 TESTS 19 140 1945600 1000
56376374 MaxHo B July 1, 2019, 6:43 a.m. OK PyPy 3 TESTS 19 140 1945600 1000
56281709 tchr B June 29, 2019, 5:11 p.m. OK PyPy 3 TESTS 19 140 1945600 1000
56270430 harshits337 B June 29, 2019, 11:52 a.m. OK PyPy 3 TESTS 19 140 1945600 1000
56164210 sprkgoyal B June 27, 2019, 1:37 p.m. OK PyPy 3 TESTS 19 140 2048000 1000
59425742 angoncal B Aug. 25, 2019, 2:17 a.m. OK Python 2 TESTS 19 171 102400 1000
57545626 Helli.code B July 22, 2019, 4:27 p.m. OK Python 2 TESTS 19 171 102400 1000
56186222 a11b11c11 B June 28, 2019, 4:59 a.m. OK Python 2 TESTS 19 171 102400 1000
56176101 Akki983 B June 27, 2019, 7:14 p.m. OK Python 2 TESTS 19 171 102400 1000
56175325 Danimator B June 27, 2019, 6:47 p.m. OK Python 2 TESTS 19 171 102400 1000
57261763 alwaysavani B July 18, 2019, 5:33 a.m. OK Python 2 TESTS 19 187 102400 1000
62091254 aTastyNoodle B Oct. 8, 2019, 5:48 a.m. OK Python 2 TESTS 19 187 307200 1000
56690252 davinstec B July 8, 2019, 3:12 a.m. OK Python 2 TESTS 19 187 409600 1000
68972944 bsr011 B Jan. 17, 2020, 7:43 a.m. OK Python 2 TESTS 19 202 102400 1000
58116332 bhuya B Aug. 1, 2019, 8:59 a.m. OK Python 2 TESTS 19 233 102400 1000
69725988 chauhan002 B Jan. 29, 2020, 12:16 p.m. OK Python 3 TESTS 19 108 0 1000
58193135 rumboalfuturo B Aug. 2, 2019, 9:04 p.m. OK Python 3 TESTS 19 108 0 1000
58144558 gr71 B Aug. 1, 2019, 8:05 p.m. OK Python 3 TESTS 19 108 0 1000
57816352 thinkingfl B July 26, 2019, 7:55 p.m. OK Python 3 TESTS 19 108 0 1000
57641089 pmaprog B July 24, 2019, 12:38 p.m. OK Python 3 TESTS 19 108 0 1000
57340711 adityarpatidar B July 19, 2019, 6:21 p.m. OK Python 3 TESTS 19 108 0 1000
56302828 ACE317 B June 30, 2019, 9:56 a.m. OK Python 3 TESTS 19 108 0 1000
56166148 crazy_bee B June 27, 2019, 2:23 p.m. OK Python 3 TESTS 19 108 0 1000
56284781 roamsev B June 29, 2019, 6:55 p.m. OK Python 3 TESTS 19 108 307200 1000
69442930 Troy1110777 B Jan. 23, 2020, 11:36 p.m. OK Python 3 TESTS 19 109 0 1000
68226101 nemi_zzz B Jan. 5, 2020, 7:12 a.m. OK Ruby TESTS 19 61 307200 1000
56271973 kobae964 B June 29, 2019, 12:29 p.m. OK Rust TESTS 19 31 307200 1000
64321128 tuna_salad B Nov. 5, 2019, 3:41 p.m. OK Rust TESTS 19 31 409600 1000

remove filters

Back to search problems