Codeforces Round 834 (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
1759 Codeforces Round 834 (Div. 3) FINISHED False 8100 68484263 Nov. 18, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18127 ) C Thermostat PROGRAMMING greedy math shortest paths

B'Vlad came home and found out that someone had reconfigured the old thermostat to the temperature of a . The thermostat can only be set to a temperature from l to r inclusive, the temperature cannot change by less than x . Formally, in one operation you can reconfigure the thermostat from temperature a to temperature b if |a - b| ge x and l <= b <= r . You are given l , r , x , a and b . Find the minimum number of operations required to get temperature b from temperature a , or say that it is impossible. The first line of input data contains the single integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the test. The descriptions of the test cases follow. The first line of each case contains three integers l , r and x ( -10^9 <= l <= r <= 10^9 , 1 <= x <= 10^9 ) -- range of temperature and minimum temperature change. The second line of each case contains two integers a and b ( l <= a, b <= r ) -- the initial and final temperatures. Output t numbers, each of which is the answer to the corresponding test case. If it is impossible to achieve the temperature b , output -1, otherwise output the minimum number of operations. In the first example, the thermostat is already set up correctly. In the second example, you can achieve the desired temperature as follows: 4 rightarrow 10 rightarrow 5 . In the third example, you can achieve the desired temperature as follows: 3 rightarrow 8 rightarrow 2 rightarrow 7 . In the fourth test, it is impossible to make any operation. '...

Tutorials

109254

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
181555451 chrisfcoder C Nov. 19, 2022, 3:35 a.m. OK C# 10 TESTS 7 109 3072000
181532475 Abu_Bakar_Siddik C Nov. 18, 2022, 7:14 p.m. OK C# 10 TESTS 7 109 3584000
181512956 VatanBaton C Nov. 18, 2022, 4:47 p.m. OK C# 8 TESTS 7 202 3481600
181548693 EDCTY C Nov. 19, 2022, 1:07 a.m. OK Clang++20 Diagnostics TESTS 7 327 0
181517181 Moka50 C Nov. 18, 2022, 5:02 p.m. OK GNU C11 TESTS 7 46 0
181563270 zhenghang C Nov. 19, 2022, 5:35 a.m. OK GNU C11 TESTS 7 46 0
181510182 ikun4831 C Nov. 18, 2022, 4:42 p.m. OK GNU C11 TESTS 7 46 0
181554275 duymao C Nov. 19, 2022, 3:14 a.m. OK GNU C11 TESTS 7 46 0
181513254 ge_zhan C Nov. 18, 2022, 4:48 p.m. OK GNU C11 TESTS 7 62 0
181516293 Abhishek_Tewatia C Nov. 18, 2022, 4:57 p.m. OK GNU C11 TESTS 7 62 0
181515266 Interested C Nov. 18, 2022, 4:53 p.m. OK GNU C11 TESTS 7 62 0
181527131 Mushfiqur_ C Nov. 18, 2022, 6:16 p.m. OK GNU C11 TESTS 7 78 0
181548931 vjudge3 C Nov. 19, 2022, 1:15 a.m. OK GNU C++14 TESTS 7 15 0
181548277 AH-20 C Nov. 19, 2022, 12:54 a.m. OK GNU C++14 TESTS 7 15 0
181524266 jeffery948 C Nov. 18, 2022, 5:49 p.m. OK GNU C++14 TESTS 7 15 0
181511863 relevtest C Nov. 18, 2022, 4:45 p.m. OK GNU C++14 TESTS 7 15 0
181510956 Gowilli C Nov. 18, 2022, 4:43 p.m. OK GNU C++14 TESTS 7 15 0
181560055 deadloss1801 C Nov. 19, 2022, 4:52 a.m. OK GNU C++14 TESTS 7 15 0
181554755 huangxinting666 C Nov. 19, 2022, 3:23 a.m. OK GNU C++14 TESTS 7 15 0
181550512 xuhh C Nov. 19, 2022, 1:56 a.m. OK GNU C++14 TESTS 7 15 0
181549844 yogahh C Nov. 19, 2022, 1:40 a.m. OK GNU C++14 TESTS 7 15 0
181560166 shattershade C Nov. 19, 2022, 4:54 a.m. OK GNU C++14 TESTS 7 30 0
181525976 eng3zim C Nov. 18, 2022, 6:04 p.m. OK GNU C++17 TESTS 7 15 0
181522468 fuon C Nov. 18, 2022, 5:34 p.m. OK GNU C++17 TESTS 7 15 0
181556520 yash_karakoti C Nov. 19, 2022, 3:53 a.m. OK GNU C++17 TESTS 7 15 0
181559223 stakudog C Nov. 19, 2022, 4:40 a.m. OK GNU C++17 TESTS 7 15 0
181559885 link_nlf C Nov. 19, 2022, 4:50 a.m. OK GNU C++17 TESTS 7 15 0
181553839 kuaileshiwo C Nov. 19, 2022, 3:04 a.m. OK GNU C++17 TESTS 7 15 0
181549794 dev_shajid C Nov. 19, 2022, 1:39 a.m. OK GNU C++17 TESTS 7 15 0
181545015 Vijay2706 C Nov. 18, 2022, 10:52 p.m. OK GNU C++17 TESTS 7 15 0
181529438 Iftikar C Nov. 18, 2022, 6:40 p.m. OK GNU C++17 TESTS 7 15 0
181541975 WalrusRamen21 C Nov. 18, 2022, 9:32 p.m. OK GNU C++17 TESTS 7 15 0
181520135 lastcode78 C Nov. 18, 2022, 5:18 p.m. OK GNU C++17 (64) TESTS 7 15 0
181561472 anawdina C Nov. 19, 2022, 5:12 a.m. OK GNU C++17 (64) TESTS 7 15 0
181561121 Caraxes C Nov. 19, 2022, 5:07 a.m. OK GNU C++17 (64) TESTS 7 15 0
181551802 tik3224 C Nov. 19, 2022, 2:24 a.m. OK GNU C++17 (64) TESTS 7 15 0
181551260 2-qiym C Nov. 19, 2022, 2:12 a.m. OK GNU C++17 (64) TESTS 7 15 0
181549053 DoTheBest_ZG C Nov. 19, 2022, 1:18 a.m. OK GNU C++17 (64) TESTS 7 15 0
181545138 Hisham_Hagag C Nov. 18, 2022, 10:56 p.m. OK GNU C++17 (64) TESTS 7 15 0
181533159 JustJie C Nov. 18, 2022, 7:21 p.m. OK GNU C++17 (64) TESTS 7 15 0
181530980 MananDahiya C Nov. 18, 2022, 6:57 p.m. OK GNU C++17 (64) TESTS 7 15 0
181519220 zwh_zzz C Nov. 18, 2022, 5:13 p.m. OK GNU C++17 (64) TESTS 7 15 0
181559535 TARUN06 C Nov. 19, 2022, 4:44 a.m. OK GNU C++20 (64) TESTS 7 15 0
181558941 alishejhf C Nov. 19, 2022, 4:35 a.m. OK GNU C++20 (64) TESTS 7 15 0
181561574 munhwas1140 C Nov. 19, 2022, 5:14 a.m. OK GNU C++20 (64) TESTS 7 15 0
181563161 macarell C Nov. 19, 2022, 5:34 a.m. OK GNU C++20 (64) TESTS 7 15 0
181563361 IUHAquarius C Nov. 19, 2022, 5:36 a.m. OK GNU C++20 (64) TESTS 7 15 0
181563727 Sabbir1807070 C Nov. 19, 2022, 5:41 a.m. OK GNU C++20 (64) TESTS 7 15 0
181563879 ankur_27 C Nov. 19, 2022, 5:43 a.m. OK GNU C++20 (64) TESTS 7 15 0
181564199 aspireboy C Nov. 19, 2022, 5:47 a.m. OK GNU C++20 (64) TESTS 7 15 0
181564407 alek0618 C Nov. 19, 2022, 5:49 a.m. OK GNU C++20 (64) TESTS 7 15 0
181565357 me_poojan23 C Nov. 19, 2022, 6 a.m. OK GNU C++20 (64) TESTS 7 15 0
181538661 rajneesh.osho C Nov. 18, 2022, 8:30 p.m. OK Java 11 TESTS 7 155 0
181515311 __Serendipity C Nov. 18, 2022, 4:53 p.m. OK Java 11 TESTS 7 187 0
181562700 vijender_8601 C Nov. 19, 2022, 5:28 a.m. OK Java 11 TESTS 7 187 0
181518356 AyushS_cg170 C Nov. 18, 2022, 5:08 p.m. OK Java 11 TESTS 7 187 0
181562015 Ankita1129 C Nov. 19, 2022, 5:20 a.m. OK Java 11 TESTS 7 202 0
181535602 princeayush04 C Nov. 18, 2022, 7:48 p.m. OK Java 11 TESTS 7 202 0
181512289 giant170 C Nov. 18, 2022, 4:46 p.m. OK Java 11 TESTS 7 202 0
181536634 AadishJain C Nov. 18, 2022, 8:01 p.m. OK Java 11 TESTS 7 264 0
181528556 singhharman C Nov. 18, 2022, 6:30 p.m. OK Java 11 TESTS 7 264 0
181518114 Siyaram_13 C Nov. 18, 2022, 5:07 p.m. OK Java 11 TESTS 7 280 0
181539225 imjayesh C Nov. 18, 2022, 8:40 p.m. OK Java 17 TESTS 7 249 409600
181555410 a_dev C Nov. 19, 2022, 3:34 a.m. OK Java 17 TESTS 7 280 614400
181557216 Suraj1607 C Nov. 19, 2022, 4:06 a.m. OK Java 17 TESTS 7 311 1126400
181525955 kumarvikash C Nov. 18, 2022, 6:04 p.m. OK Java 17 TESTS 7 342 819200
181512633 sanjeevKumar1903 C Nov. 18, 2022, 4:47 p.m. OK Java 17 TESTS 7 374 204800
181517279 rajashish914 C Nov. 18, 2022, 5:02 p.m. OK Java 17 TESTS 7 420 102400
181562943 leonlian C Nov. 19, 2022, 5:31 a.m. OK Java 8 TESTS 7 93 0
181518855 priyaroy3370 C Nov. 18, 2022, 5:11 p.m. OK Java 8 TESTS 7 108 0
181516144 raj_shahh C Nov. 18, 2022, 4:57 p.m. OK Java 8 TESTS 7 109 0
181511422 ankit_0207 C Nov. 18, 2022, 4:44 p.m. OK Java 8 TESTS 7 109 0
181559178 avinendra08 C Nov. 19, 2022, 4:39 a.m. OK Java 8 TESTS 7 124 0
181528849 Zicode C Nov. 18, 2022, 6:33 p.m. OK Java 8 TESTS 7 124 0
181516201 ankit_0207 C Nov. 18, 2022, 4:57 p.m. OK Java 8 TESTS 7 124 0
181514196 guinnod C Nov. 18, 2022, 4:49 p.m. OK Java 8 TESTS 7 140 0
181513006 Bahaalization C Nov. 18, 2022, 4:47 p.m. OK Java 8 TESTS 7 171 0
181557725 OctopusKiller C Nov. 19, 2022, 4:14 a.m. OK Java 8 TESTS 7 186 0
181541933 ivan_dashkevich C Nov. 18, 2022, 9:32 p.m. OK JavaScript TESTS 7 156 1536000
181526244 Krantzy C Nov. 18, 2022, 6:07 p.m. OK Kotlin 1.7 TESTS 7 499 23552000
181536278 whiteReboot C Nov. 18, 2022, 7:57 p.m. OK MS C++ 2017 TESTS 7 62 0
181511636 Electrony C Nov. 18, 2022, 4:45 p.m. OK MS C++ 2017 TESTS 7 93 0
181532435 u1602016 C Nov. 18, 2022, 7:13 p.m. OK PyPy 3 TESTS 7 202 8089600
181525977 sw_enthusiast C Nov. 18, 2022, 6:04 p.m. OK PyPy 3 TESTS 7 233 74752000
181546681 zmonster8 C Nov. 18, 2022, 11:55 p.m. OK PyPy 3 TESTS 7 468 9728000
181537621 Lammert0907 C Nov. 18, 2022, 8:15 p.m. OK PyPy 3 TESTS 7 514 9932800
181544786 dawitys010 C Nov. 18, 2022, 10:44 p.m. OK PyPy 3 TESTS 7 608 9625600
181543960 TODAISY C Nov. 18, 2022, 10:19 p.m. OK PyPy 3 TESTS 7 733 10035200
181545408 vishnesh C Nov. 18, 2022, 11:05 p.m. OK PyPy 3 TESTS 7 951 9830400
181555465 Ninym_ C Nov. 19, 2022, 3:35 a.m. OK PyPy 3-64 TESTS 7 139 8499200
181553015 bokunopicolo C Nov. 19, 2022, 2:48 a.m. OK PyPy 3-64 TESTS 7 155 9523200
181525687 Vashesh C Nov. 18, 2022, 6:01 p.m. OK PyPy 3-64 TESTS 7 155 9932800
181564768 Mr._Oogway C Nov. 19, 2022, 5:53 a.m. OK PyPy 3-64 TESTS 7 186 10137600
181528457 hkwu6013 C Nov. 18, 2022, 6:29 p.m. OK PyPy 3-64 TESTS 7 186 10752000
181516017 kavorka C Nov. 18, 2022, 4:56 p.m. OK PyPy 3-64 TESTS 7 186 13209600
181541708 Su_123 C Nov. 18, 2022, 9:26 p.m. OK PyPy 3-64 TESTS 7 187 11059200
181513997 pizet C Nov. 18, 2022, 4:49 p.m. OK PyPy 3-64 TESTS 7 202 10444800
181524703 FrozenKandy C Nov. 18, 2022, 5:52 p.m. OK PyPy 3-64 TESTS 7 202 10649600
181531301 golo C Nov. 18, 2022, 7:01 p.m. OK PyPy 3-64 TESTS 7 233 15769600
181512627 aliizadi208 C Nov. 18, 2022, 4:47 p.m. OK Python 3 TESTS 7 108 204800
181564895 singh121 C Nov. 19, 2022, 5:55 a.m. OK Python 3 TESTS 7 108 1126400
181532573 a2bailey C Nov. 18, 2022, 7:15 p.m. OK Python 3 TESTS 7 124 204800
181539170 AAE C Nov. 18, 2022, 8:39 p.m. OK Python 3 TESTS 7 140 0
181526040 gokulraaj59 C Nov. 18, 2022, 6:05 p.m. OK Python 3 TESTS 7 140 0
181518308 eugalt C Nov. 18, 2022, 5:08 p.m. OK Python 3 TESTS 7 140 0
181511879 Neloy-SWE C Nov. 18, 2022, 4:45 p.m. OK Python 3 TESTS 7 140 0
181540669 lucbarn C Nov. 18, 2022, 9:04 p.m. OK Python 3 TESTS 7 155 0
181529928 chaosdevil C Nov. 18, 2022, 6:45 p.m. OK Python 3 TESTS 7 155 0
181525711 eugalt C Nov. 18, 2022, 6:02 p.m. OK Python 3 TESTS 7 155 0
181541655 liut C Nov. 18, 2022, 9:25 p.m. OK Rust 2021 TESTS 7 30 0

remove filters

Back to search problems