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 |
---|---|---|---|---|---|---|
1704 | CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 9000 | 77990063 | July 31, 2022, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 19311 ) | B | Luke is a Foodie | PROGRAMMING | greedy |
B"Luke likes to eat. There are n piles of food aligned in a straight line in front of him. The i -th pile contains a_i units of food. Luke will walk from the 1 -st pile towards the n -th pile, and he wants to eat every pile of food without walking back. When Luke reaches the i -th pile, he can eat that pile if and only if |v - a_i| <= q x , where x is a fixed integer, and v is Luke's food affinity. Before Luke starts to walk, he can set v to any integer. Also, for each i ( 1 <= q i <= q n ), Luke can change his food affinity to any integer before he eats the i -th pile. Find the minimum number of changes needed to eat every pile of food. Note that the initial choice for v is not considered as a change. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of test cases follows. For each test case, the first line contains two integers, n, x ( 1 <= q n <= q 2 cdot 10^5 , 1 <= q x <= q 10^9 ) -- the number of piles, and the maximum difference between the size of a pile and Luke's food affinity, such that Luke can eat the pile. The second line contains n integers a_1, a_2, ldots , a_n ( 1 <= q a_i <= q 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output an integer on a separate line, which is the minimum number of changes needed. In the first test case, Luke can set v to 5 before he starts to walk. And he can walk straight to eat every piles of food without changing v . In the second test case, Luke can set v to 3 before he starts to walk. And he could change v to 10 before he eats the second pile. After that, he can walk straight to eat remaining food without changing v . In the fourth test case, Luke can set v to"... |
CodeTON Round 2 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
166399230 | TheILICH | B | July 31, 2022, 4:31 p.m. | OK | C# 8 | TESTS | 59 | 156 | 17715200 | ||
166388748 | Gastan | B | July 31, 2022, 3:41 p.m. | OK | GNU C11 | TESTS | 59 | 62 | 819200 | ||
166383109 | conqueror_of_marinush | B | July 31, 2022, 3:19 p.m. | OK | GNU C11 | TESTS | 59 | 62 | 819200 | ||
166440558 | SP2003 | B | Aug. 1, 2022, 4:51 a.m. | OK | GNU C11 | TESTS | 59 | 77 | 0 | ||
166422444 | SkinnySnakeLimb | B | July 31, 2022, 10:49 p.m. | OK | GNU C11 | TESTS | 59 | 78 | 819200 | ||
166390330 | Keshavrg49 | B | July 31, 2022, 3:48 p.m. | OK | GNU C11 | TESTS | 59 | 78 | 819200 | ||
166384886 | LJWWDER | B | July 31, 2022, 3:26 p.m. | OK | GNU C11 | TESTS | 59 | 78 | 819200 | ||
166383379 | vvishal_05 | B | July 31, 2022, 3:20 p.m. | OK | GNU C11 | TESTS | 59 | 93 | 1638400 | ||
166435053 | xsdjg | B | Aug. 1, 2022, 3:16 a.m. | OK | GNU C++14 | TESTS | 59 | 31 | 921600 | ||
166426348 | win10 | B | Aug. 1, 2022, 12:56 a.m. | OK | GNU C++14 | TESTS | 59 | 31 | 3686400 | ||
166427651 | 2018gtyz10 | B | Aug. 1, 2022, 1:20 a.m. | OK | GNU C++14 | TESTS | 59 | 62 | 0 | ||
166427068 | lucasnnn | B | Aug. 1, 2022, 1:11 a.m. | OK | GNU C++14 | TESTS | 59 | 62 | 0 | ||
166417669 | carre | B | July 31, 2022, 8:46 p.m. | OK | GNU C++14 | TESTS | 59 | 62 | 0 | ||
166413013 | HERO_Comming | B | July 31, 2022, 7:31 p.m. | OK | GNU C++14 | TESTS | 59 | 62 | 0 | ||
166407949 | Vibhum | B | July 31, 2022, 6:29 p.m. | OK | GNU C++14 | TESTS | 59 | 62 | 0 | ||
166383272 | SunnyYuan | B | July 31, 2022, 3:19 p.m. | OK | GNU C++14 | TESTS | 59 | 62 | 0 | ||
166444124 | shayancoder | B | Aug. 1, 2022, 5:49 a.m. | OK | GNU C++14 | TESTS | 59 | 62 | 819200 | ||
166442218 | suraj.xd | B | Aug. 1, 2022, 5:20 a.m. | OK | GNU C++14 | TESTS | 59 | 62 | 819200 | ||
166386654 | yixingstd | B | July 31, 2022, 3:32 p.m. | OK | GNU C++17 | TESTS | 59 | 46 | 0 | ||
166385173 | hydro-bot3 | B | July 31, 2022, 3:27 p.m. | OK | GNU C++17 | TESTS | 59 | 46 | 35532800 | ||
166414079 | Mashrur | B | July 31, 2022, 7:47 p.m. | OK | GNU C++17 | TESTS | 59 | 62 | 0 | ||
166383852 | lylyyds | B | July 31, 2022, 3:22 p.m. | OK | GNU C++17 | TESTS | 59 | 62 | 0 | ||
166423692 | riad | B | July 31, 2022, 11:37 p.m. | OK | GNU C++17 | TESTS | 59 | 62 | 0 | ||
166428119 | closed_id | B | Aug. 1, 2022, 1:26 a.m. | OK | GNU C++17 | TESTS | 59 | 62 | 0 | ||
166438169 | kobeforces | B | Aug. 1, 2022, 4:06 a.m. | OK | GNU C++17 | TESTS | 59 | 62 | 0 | ||
166438244 | HKZG | B | Aug. 1, 2022, 4:07 a.m. | OK | GNU C++17 | TESTS | 59 | 62 | 819200 | ||
166442035 | Aditya_871 | B | Aug. 1, 2022, 5:17 a.m. | OK | GNU C++17 | TESTS | 59 | 62 | 819200 | ||
166439577 | Njaso | B | Aug. 1, 2022, 4:34 a.m. | OK | GNU C++17 | TESTS | 59 | 62 | 819200 | ||
166405890 | mesbah19 | B | July 31, 2022, 6:14 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 0 | ||
166441787 | m0fum0fu | B | Aug. 1, 2022, 5:13 a.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 0 | ||
166413057 | Makcum888 | B | July 31, 2022, 7:31 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 0 | ||
166406443 | AkramElOmrani | B | July 31, 2022, 6:17 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 0 | ||
166395375 | shamimjucse | B | July 31, 2022, 4:12 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 0 | ||
166444941 | elena44xx | B | Aug. 1, 2022, 6 a.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 819200 | ||
166393706 | mahbubhasanmht | B | July 31, 2022, 4:04 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 819200 | ||
166383325 | Andy_Delgado | B | July 31, 2022, 3:20 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 819200 | ||
166411951 | illume2021 | B | July 31, 2022, 7:16 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 819200 | ||
166434375 | wx13479893646 | B | Aug. 1, 2022, 3:05 a.m. | OK | GNU C++17 (64) | TESTS | 59 | 46 | 819200 | ||
166417624 | MrM7mD | B | July 31, 2022, 8:45 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 31 | 0 | ||
166415033 | Coder_5570 | B | July 31, 2022, 8 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166414065 | mada40 | B | July 31, 2022, 7:46 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166415130 | agrawalpiyush | B | July 31, 2022, 8:02 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166418329 | OmarIbahim | B | July 31, 2022, 8:57 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166418427 | dranjohn | B | July 31, 2022, 8:59 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166420120 | mamke | B | July 31, 2022, 9:31 p.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166436839 | chiking | B | Aug. 1, 2022, 3:44 a.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166438795 | Pikku | B | Aug. 1, 2022, 4:18 a.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166442531 | akshaykhandelwal | B | Aug. 1, 2022, 5:24 a.m. | OK | GNU C++20 (64) | TESTS | 59 | 46 | 0 | ||
166433826 | dagnaf | B | Aug. 1, 2022, 2:56 a.m. | OK | Go | TESTS | 59 | 156 | 4300800 | ||
166443662 | min.khanthtoo1729 | B | Aug. 1, 2022, 5:42 a.m. | OK | Haskell | TESTS | 59 | 77 | 4300800 | ||
166435108 | min.khanthtoo1729 | B | Aug. 1, 2022, 3:17 a.m. | OK | Haskell | TESTS | 59 | 982 | 1126400 | ||
166444305 | Heni_2021 | B | Aug. 1, 2022, 5:51 a.m. | OK | Java 11 | TESTS | 59 | 186 | 0 | ||
166437126 | KarMa_ | B | Aug. 1, 2022, 3:49 a.m. | OK | Java 11 | TESTS | 59 | 186 | 0 | ||
166411705 | iamavalon | B | July 31, 2022, 7:13 p.m. | OK | Java 11 | TESTS | 59 | 202 | 0 | ||
166396153 | Sarvjeet619 | B | July 31, 2022, 4:16 p.m. | OK | Java 11 | TESTS | 59 | 202 | 0 | ||
166444648 | dhruvil_8803 | B | Aug. 1, 2022, 5:56 a.m. | OK | Java 11 | TESTS | 59 | 218 | 0 | ||
166435402 | __Serendipity | B | Aug. 1, 2022, 3:21 a.m. | OK | Java 11 | TESTS | 59 | 218 | 0 | ||
166413592 | goyalronak3 | B | July 31, 2022, 7:39 p.m. | OK | Java 11 | TESTS | 59 | 218 | 0 | ||
166405794 | the_unseen | B | July 31, 2022, 6:13 p.m. | OK | Java 11 | TESTS | 59 | 233 | 0 | ||
166432919 | GoldenShadow | B | Aug. 1, 2022, 2:42 a.m. | OK | Java 11 | TESTS | 59 | 248 | 0 | ||
166390310 | praduman14 | B | July 31, 2022, 3:48 p.m. | OK | Java 11 | TESTS | 59 | 249 | 0 | ||
166411516 | Rajveer_100 | B | July 31, 2022, 7:10 p.m. | OK | Java 17 | TESTS | 59 | 264 | 512000 | ||
166407319 | harman1148 | B | July 31, 2022, 6:24 p.m. | OK | Java 17 | TESTS | 59 | 296 | 22425600 | ||
166408306 | ItsZaki | B | July 31, 2022, 6:33 p.m. | OK | Java 17 | TESTS | 59 | 327 | 5427200 | ||
166382821 | _arcade | B | July 31, 2022, 3:18 p.m. | OK | Java 17 | TESTS | 59 | 560 | 819200 | ||
166395335 | AnshulShukla | B | July 31, 2022, 4:12 p.m. | OK | Java 17 | TESTS | 59 | 623 | 1024000 | ||
166396516 | periyakaruppan | B | July 31, 2022, 4:18 p.m. | OK | Java 17 | TESTS | 59 | 624 | 1024000 | ||
166405803 | swarup_312 | B | July 31, 2022, 6:14 p.m. | OK | Java 8 | TESTS | 59 | 140 | 0 | ||
166410996 | Mohamed_A7med | B | July 31, 2022, 7:04 p.m. | OK | Java 8 | TESTS | 59 | 155 | 2764800 | ||
166406846 | Mohamed308 | B | July 31, 2022, 6:20 p.m. | OK | Java 8 | TESTS | 59 | 155 | 2764800 | ||
166389610 | ggghg | B | July 31, 2022, 3:44 p.m. | OK | Java 8 | TESTS | 59 | 170 | 2764800 | ||
166389603 | T_PAVAN_NAGARAJU | B | July 31, 2022, 3:44 p.m. | OK | Java 8 | TESTS | 59 | 171 | 2764800 | ||
166387489 | pavandandu | B | July 31, 2022, 3:35 p.m. | OK | Java 8 | TESTS | 59 | 171 | 2764800 | ||
166382633 | rock_777 | B | July 31, 2022, 3:17 p.m. | OK | Java 8 | TESTS | 59 | 171 | 2764800 | ||
166405999 | gssakash | B | July 31, 2022, 6:15 p.m. | OK | Java 8 | TESTS | 59 | 171 | 2969600 | ||
166391997 | yashpandey73 | B | July 31, 2022, 3:55 p.m. | OK | Java 8 | TESTS | 59 | 171 | 4300800 | ||
166414005 | CrinklyGolem | B | July 31, 2022, 7:45 p.m. | OK | Java 8 | TESTS | 59 | 171 | 4608000 | ||
166413144 | SlavaG | B | July 31, 2022, 7:33 p.m. | OK | Kotlin 1.6 | TESTS | 59 | 358 | 17305600 | ||
166390412 | vjgarcia | B | July 31, 2022, 3:48 p.m. | OK | Kotlin 1.6 | TESTS | 59 | 592 | 1638400 | ||
166385082 | Mrs.zhou | B | July 31, 2022, 3:26 p.m. | OK | MS C++ 2017 | TESTS | 59 | 93 | 1638400 | ||
166436628 | Fish_L | B | Aug. 1, 2022, 3:41 a.m. | OK | MS C++ 2017 | TESTS | 59 | 187 | 819200 | ||
166388595 | philip_lol | B | July 31, 2022, 3:40 p.m. | OK | MS C++ 2017 | TESTS | 59 | 187 | 3993600 | ||
166383266 | Ayushcoder | B | July 31, 2022, 3:19 p.m. | OK | MS C++ 2017 | TESTS | 59 | 202 | 0 | ||
166382834 | Tor_250 | B | July 31, 2022, 3:18 p.m. | OK | MS C++ 2017 | TESTS | 59 | 202 | 0 | ||
166382530 | JustOnlyOne | B | July 31, 2022, 3:17 p.m. | OK | MS C++ 2017 | TESTS | 59 | 202 | 0 | ||
166387909 | nanasin | B | July 31, 2022, 3:37 p.m. | OK | MS C++ 2017 | TESTS | 59 | 202 | 819200 | ||
166432062 | Suyash_R10 | B | Aug. 1, 2022, 2:29 a.m. | OK | MS C++ 2017 | TESTS | 59 | 202 | 2252800 | ||
166387844 | OmarRnr | B | July 31, 2022, 3:37 p.m. | OK | MS C++ 2017 | TESTS | 59 | 218 | 819200 | ||
166422046 | Crimson_Quasar | B | July 31, 2022, 10:38 p.m. | OK | MS C++ 2017 | TESTS | 59 | 218 | 921600 | ||
166405865 | 1_2_3_4_5_9 | B | July 31, 2022, 6:14 p.m. | OK | PyPy 2 | TESTS | 59 | 218 | 25190400 | ||
166433163 | YMSeah | B | Aug. 1, 2022, 2:46 a.m. | OK | PyPy 3 | TESTS | 59 | 156 | 16998400 | ||
166424974 | WalrusRamen21 | B | Aug. 1, 2022, 12:20 a.m. | OK | PyPy 3 | TESTS | 59 | 296 | 15564800 | ||
166392780 | leegh963 | B | July 31, 2022, 3:59 p.m. | OK | PyPy 3 | TESTS | 59 | 311 | 15462400 | ||
166436312 | kraanzu | B | Aug. 1, 2022, 3:36 a.m. | OK | PyPy 3 | TESTS | 59 | 312 | 89292800 | ||
166383880 | Zeus221B | B | July 31, 2022, 3:22 p.m. | OK | PyPy 3 | TESTS | 59 | 327 | 19046400 | ||
166436087 | abeni5049 | B | Aug. 1, 2022, 3:32 a.m. | OK | PyPy 3 | TESTS | 59 | 343 | 17920000 | ||
166395639 | pawan_7r | B | July 31, 2022, 4:14 p.m. | OK | PyPy 3 | TESTS | 59 | 436 | 19148800 | ||
166390214 | doniyorbek7376 | B | July 31, 2022, 3:47 p.m. | OK | PyPy 3 | TESTS | 59 | 452 | 19148800 | ||
166423970 | WalrusRamen21 | B | July 31, 2022, 11:46 p.m. | OK | PyPy 3 | TESTS | 59 | 467 | 19148800 | ||
166383179 | Mathevil | B | July 31, 2022, 3:19 p.m. | OK | PyPy 3 | TESTS | 59 | 467 | 19148800 | ||
166410805 | zii.hrs | B | July 31, 2022, 7:02 p.m. | OK | PyPy 3-64 | TESTS | 59 | 124 | 30105600 | ||
166444324 | kaustavshouvik | B | Aug. 1, 2022, 5:52 a.m. | OK | PyPy 3-64 | TESTS | 59 | 139 | 21299200 | ||
166444979 | Yansou | B | Aug. 1, 2022, 6:01 a.m. | OK | PyPy 3-64 | TESTS | 59 | 140 | 21299200 | ||
166433209 | bridgekiller | B | Aug. 1, 2022, 2:47 a.m. | OK | PyPy 3-64 | TESTS | 59 | 140 | 30105600 | ||
166439183 | only_noob | B | Aug. 1, 2022, 4:26 a.m. | OK | PyPy 3-64 | TESTS | 59 | 140 | 30310400 | ||
166437850 | Youarenotgood | B | Aug. 1, 2022, 4 a.m. | OK | PyPy 3-64 | TESTS | 59 | 140 | 30310400 | ||
166442794 | poornaTheja | B | Aug. 1, 2022, 5:28 a.m. | OK | PyPy 3-64 | TESTS | 59 | 155 | 20992000 | ||
166412754 | ahmedsiad | B | July 31, 2022, 7:27 p.m. | OK | PyPy 3-64 | TESTS | 59 | 155 | 27443200 | ||
166392339 | Amay12 | B | July 31, 2022, 3:57 p.m. | OK | PyPy 3-64 | TESTS | 59 | 155 | 29081600 | ||
166444504 | BingHa | B | Aug. 1, 2022, 5:54 a.m. | OK | PyPy 3-64 | TESTS | 59 | 155 | 30105600 | ||
166388527 | tangyulong | B | July 31, 2022, 3:40 p.m. | OK | Python 3 | TESTS | 59 | 202 | 17408000 | ||
166383961 | RandomGuyOnTheInternet | B | July 31, 2022, 3:22 p.m. | OK | Python 3 | TESTS | 59 | 234 | 16384000 | ||
166383431 | GuilhermeST | B | July 31, 2022, 3:20 p.m. | OK | Python 3 | TESTS | 59 | 234 | 16691200 | ||
166394325 | noob_hustler | B | July 31, 2022, 4:07 p.m. | OK | Python 3 | TESTS | 59 | 248 | 16076800 | ||
166389532 | bettyyw | B | July 31, 2022, 3:44 p.m. | OK | Python 3 | TESTS | 59 | 265 | 15872000 | ||
166393556 | CHEATER_BUSTED | B | July 31, 2022, 4:03 p.m. | OK | Python 3 | TESTS | 59 | 265 | 16384000 | ||
166386943 | Arunava_392 | B | July 31, 2022, 3:33 p.m. | OK | Python 3 | TESTS | 59 | 265 | 16384000 | ||
166412457 | flash196 | B | July 31, 2022, 7:24 p.m. | OK | Python 3 | TESTS | 59 | 265 | 16691200 | ||
166428350 | WJ.L | B | Aug. 1, 2022, 1:30 a.m. | OK | Python 3 | TESTS | 59 | 280 | 16384000 | ||
166384455 | _Ajay_ | B | July 31, 2022, 3:24 p.m. | OK | Python 3 | TESTS | 59 | 280 | 16384000 | ||
166414865 | Thallium54 | B | July 31, 2022, 7:58 p.m. | OK | Rust 2021 | TESTS | 59 | 31 | 4198400 | ||
166388033 | Hyrulia | B | July 31, 2022, 3:38 p.m. | OK | Rust 2021 | TESTS | 59 | 31 | 5427200 | ||
166392396 | luukaos | B | July 31, 2022, 3:57 p.m. | OK | Rust 2021 | TESTS | 59 | 93 | 7884800 | ||
166387727 | macosta | B | July 31, 2022, 3:37 p.m. | OK | Rust 2021 | TESTS | 59 | 108 | 16691200 | ||
166384997 | songtianyi | B | July 31, 2022, 3:26 p.m. | OK | Rust 2021 | TESTS | 59 | 155 | 7884800 |
Back to search problems