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 |
---|---|---|---|---|---|---|
1922 | Educational Codeforces Round 161 (Rated for Div. 2) | FINISHED | False | 7200 | 31591463 | Jan. 18, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 19175 ) | C | Closest Cities | PROGRAMMING | greedy |
B"There are n cities located on the number line, the i -th city is in the point a_i . The coordinates of the cities are given in ascending order, so a_1 < a_2 < ... < a_n . The distance between two cities x and y is equal to |a_x - a_y| . For each city i , let's define the closest city j as the city such that the distance between i and j is not greater than the distance between i and each other city k . For example, if the cities are located in points [0, 8, 12, 15, 20] , then: The cities are located in such a way that for every city, the closest city is unique. For example, it is impossible for the cities to be situated in points [1, 2, 3] , since this would mean that the city 2 has two closest cities ( 1 and 3 , both having distance 1 ). You can travel between cities. Suppose you are currently in the city x . Then you can perform one of the following actions: You are given m queries. In each query, you will be given two cities, and you have to calculate the minimum number of coins you have to spend to travel from one city to the other city. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case is given in the following format: Additional constraints on the input: For each query, print one integer -- the minimum number of coins you have to spend. Let's consider the first two queries in the example from the statement: "... |
Educational Codeforces Round 161 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
242337988 | NenadDapic | C | Jan. 18, 2024, 6:10 p.m. | OK | FPC | TESTS | 4 | 358 | 1228800 | ||
242335773 | iffatul_anon | C | Jan. 18, 2024, 5:53 p.m. | OK | GNU C11 | TESTS | 4 | 483 | 1228800 | ||
242329228 | sabhinav22 | C | Jan. 18, 2024, 5:11 p.m. | OK | GNU C11 | TESTS | 4 | 514 | 2662400 | ||
242328701 | hscpy | C | Jan. 18, 2024, 5:08 p.m. | OK | GNU C11 | TESTS | 4 | 530 | 1433600 | ||
242339960 | harut_13 | C | Jan. 18, 2024, 6:25 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 2457600 | ||
242337179 | _MON_JU_ | C | Jan. 18, 2024, 6:03 p.m. | OK | GNU C++17 | TESTS | 4 | 77 | 4608000 | ||
242346595 | Risan99 | C | Jan. 18, 2024, 7:31 p.m. | OK | GNU C++17 | TESTS | 4 | 78 | 1228800 | ||
242374794 | Vivi_zhaojingqi | C | Jan. 19, 2024, 5:01 a.m. | OK | GNU C++17 | TESTS | 10 | 92 | 5017600 | ||
242365407 | yhkhoo | C | Jan. 19, 2024, 2:41 a.m. | OK | GNU C++17 | TESTS | 4 | 93 | 1228800 | ||
242357103 | MaxWelll | C | Jan. 18, 2024, 10:50 p.m. | OK | GNU C++17 | TESTS | 4 | 93 | 1228800 | ||
242337126 | iij | C | Jan. 18, 2024, 6:03 p.m. | OK | GNU C++17 | TESTS | 4 | 93 | 1228800 | ||
242373639 | neo11235 | C | Jan. 19, 2024, 4:47 a.m. | OK | GNU C++17 | TESTS | 10 | 93 | 1228800 | ||
242366565 | _AhSaN_ | C | Jan. 19, 2024, 3:01 a.m. | OK | GNU C++17 | TESTS | 4 | 93 | 1228800 | ||
242377492 | KroosTheKeenGlint | C | Jan. 19, 2024, 5:27 a.m. | OK | GNU C++17 | TESTS | 10 | 93 | 1228800 | ||
242358651 | chappy1 | C | Jan. 18, 2024, 11:40 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 30 | 5939200 | ||
242363452 | enslaved | C | Jan. 19, 2024, 2:01 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 46 | 3276800 | ||
242329950 | Letcode4403 | C | Jan. 18, 2024, 5:15 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 1228800 | ||
242363560 | Yn_ns | C | Jan. 19, 2024, 2:04 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 1228800 | ||
242352650 | BhavyaBhatt | C | Jan. 18, 2024, 8:54 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 1228800 | ||
242340724 | Md_Minhaj | C | Jan. 18, 2024, 6:31 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 2355200 | ||
242363852 | H_obert | C | Jan. 19, 2024, 2:10 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 2457600 | ||
242323812 | Konggee. | C | Jan. 18, 2024, 4:46 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 3993600 | ||
242360033 | 113113113aaasssddd | C | Jan. 19, 2024, 12:32 a.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 4812800 | ||
242326797 | _dkdk_ | C | Jan. 18, 2024, 4:58 p.m. | OK | GNU C++17 (64) | TESTS | 4 | 61 | 7168000 | ||
242346100 | dk0001 | C | Jan. 18, 2024, 7:25 p.m. | OK | GNU C++20 (64) | TESTS | 4 | 31 | 3993600 | ||
242368756 | AkiyamaMizuk1 | C | Jan. 19, 2024, 3:36 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242367387 | Tiwwp8n24 | C | Jan. 19, 2024, 3:15 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242366851 | Captainfly | C | Jan. 19, 2024, 3:05 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242366685 | SF-Manman | C | Jan. 19, 2024, 3:02 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242365244 | XHZJZ | C | Jan. 19, 2024, 2:39 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242365088 | HeroicMage | C | Jan. 19, 2024, 2:36 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242364404 | de3d_inside | C | Jan. 19, 2024, 2:23 a.m. | OK | GNU C++20 (64) | TESTS | 4 | 46 | 1228800 | ||
242377676 | AmateurCode | C | Jan. 19, 2024, 5:29 a.m. | OK | GNU C++20 (64) | TESTS | 10 | 46 | 1228800 | ||
242378038 | tilenn | C | Jan. 19, 2024, 5:32 a.m. | OK | GNU C++20 (64) | TESTS | 10 | 46 | 1228800 | ||
242353433 | kiruxan | C | Jan. 18, 2024, 9:10 p.m. | OK | Go | TESTS | 4 | 327 | 12390400 | ||
242354267 | susvant | C | Jan. 18, 2024, 9:29 p.m. | OK | Java 21 | TESTS | 4 | 233 | 307200 | ||
242338607 | Mikoroso | C | Jan. 18, 2024, 6:14 p.m. | OK | Java 21 | TESTS | 4 | 296 | 2048000 | ||
242346602 | Harwinvanak | C | Jan. 18, 2024, 7:31 p.m. | OK | Java 21 | TESTS | 4 | 358 | 0 | ||
242325751 | minibin | C | Jan. 18, 2024, 4:54 p.m. | OK | Java 21 | TESTS | 4 | 358 | 409600 | ||
242339902 | mohit458 | C | Jan. 18, 2024, 6:24 p.m. | OK | Java 21 | TESTS | 4 | 358 | 3072000 | ||
242348180 | java_noob69 | C | Jan. 18, 2024, 7:48 p.m. | OK | Java 21 | TESTS | 4 | 373 | 35840000 | ||
242340481 | mohit458 | C | Jan. 18, 2024, 6:28 p.m. | OK | Java 21 | TESTS | 4 | 374 | 3174400 | ||
242323751 | priyaroy3370 | C | Jan. 18, 2024, 4:46 p.m. | OK | Java 21 | TESTS | 4 | 389 | 307200 | ||
242340250 | mohit458 | C | Jan. 18, 2024, 6:27 p.m. | OK | Java 21 | TESTS | 4 | 389 | 2662400 | ||
242343558 | Xing_ke | C | Jan. 18, 2024, 6:57 p.m. | OK | Java 21 | TESTS | 4 | 436 | 0 | ||
242332475 | qwerty12345qwerty | C | Jan. 18, 2024, 5:31 p.m. | OK | Java 8 | TESTS | 4 | 514 | 0 | ||
242378446 | Gavind | C | Jan. 19, 2024, 5:36 a.m. | OK | Java 8 | TESTS | 10 | 795 | 6144000 | ||
242326101 | numairj9a | C | Jan. 18, 2024, 4:55 p.m. | OK | Java 8 | TESTS | 4 | 811 | 5222400 | ||
242378193 | Gavind | C | Jan. 19, 2024, 5:34 a.m. | OK | Java 8 | TESTS | 10 | 811 | 6144000 | ||
242343596 | Sumitsingh7 | C | Jan. 18, 2024, 6:57 p.m. | OK | Java 8 | TESTS | 4 | 811 | 7475200 | ||
242343572 | -__Aiko__- | C | Jan. 18, 2024, 6:57 p.m. | OK | Java 8 | TESTS | 4 | 1076 | 0 | ||
242345891 | ChiragNayak | C | Jan. 18, 2024, 7:22 p.m. | OK | Java 8 | TESTS | 4 | 1122 | 0 | ||
242326177 | Yassinjan | C | Jan. 18, 2024, 4:56 p.m. | OK | Java 8 | TESTS | 4 | 1138 | 0 | ||
242327593 | Yassinjan | C | Jan. 18, 2024, 5:02 p.m. | OK | Java 8 | TESTS | 4 | 1138 | 0 | ||
242354299 | IITeens | C | Jan. 18, 2024, 9:29 p.m. | OK | MS C++ 2017 | TESTS | 4 | 576 | 1228800 | ||
242342861 | akhand8500 | C | Jan. 18, 2024, 6:50 p.m. | OK | MS C++ 2017 | TESTS | 4 | 576 | 2662400 | ||
242368983 | Pandit_Jwalit | C | Jan. 19, 2024, 3:39 a.m. | OK | MS C++ 2017 | TESTS | 4 | 608 | 1228800 | ||
242374770 | vamsidhar24 | C | Jan. 19, 2024, 5:01 a.m. | OK | MS C++ 2017 | TESTS | 10 | 608 | 3174400 | ||
242344011 | AvanSingh | C | Jan. 18, 2024, 7:02 p.m. | OK | MS C++ 2017 | TESTS | 4 | 623 | 2457600 | ||
242378898 | fww | C | Jan. 19, 2024, 5:40 a.m. | OK | MS C++ 2017 | TESTS | 10 | 639 | 1228800 | ||
242375006 | ysysn | C | Jan. 19, 2024, 5:04 a.m. | OK | MS C++ 2017 | TESTS | 10 | 639 | 1228800 | ||
242323083 | ng_jahkhanh39 | C | Jan. 18, 2024, 4:44 p.m. | OK | MS C++ 2017 | TESTS | 4 | 639 | 2457600 | ||
242371081 | Square_Sponge | C | Jan. 19, 2024, 4:10 a.m. | OK | MS C++ 2017 | TESTS | 4 | 1980 | 7270400 | ||
242346587 | rsFalse | C | Jan. 18, 2024, 7:30 p.m. | OK | Perl | TESTS | 4 | 577 | 28774400 | ||
242355976 | crapcode | C | Jan. 18, 2024, 10:15 p.m. | OK | PHP | TESTS | 4 | 623 | 23142400 | ||
242354023 | crapcode | C | Jan. 18, 2024, 9:23 p.m. | OK | PHP | TESTS | 4 | 624 | 23142400 | ||
242367909 | YMSeah | C | Jan. 19, 2024, 3:23 a.m. | OK | PyPy 3 | TESTS | 4 | 280 | 17305600 | ||
242337547 | Paras2856 | C | Jan. 18, 2024, 6:06 p.m. | OK | PyPy 3 | TESTS | 4 | 1684 | 19148800 | ||
242381467 | gardengnome | C | Jan. 19, 2024, 6:02 a.m. | OK | PyPy 3-64 | TESTS | 10 | 155 | 14950400 | ||
242380550 | gardengnome | C | Jan. 19, 2024, 5:54 a.m. | OK | PyPy 3-64 | TESTS | 10 | 155 | 15462400 | ||
242371990 | cybsbbb | C | Jan. 19, 2024, 4:23 a.m. | OK | PyPy 3-64 | TESTS | 4 | 202 | 14336000 | ||
242354932 | gardengnome | C | Jan. 18, 2024, 9:45 p.m. | OK | PyPy 3-64 | TESTS | 4 | 202 | 15052800 | ||
242343410 | NitroSpear | C | Jan. 18, 2024, 6:55 p.m. | OK | PyPy 3-64 | TESTS | 4 | 202 | 18534400 | ||
242337158 | AHappyPotato | C | Jan. 18, 2024, 6:03 p.m. | OK | PyPy 3-64 | TESTS | 4 | 217 | 13516800 | ||
242361932 | Remineva | C | Jan. 19, 2024, 1:26 a.m. | OK | PyPy 3-64 | TESTS | 4 | 217 | 20377600 | ||
242378705 | rahul_opz | C | Jan. 19, 2024, 5:38 a.m. | OK | PyPy 3-64 | TESTS | 10 | 218 | 14745600 | ||
242330090 | Skam_ | C | Jan. 18, 2024, 5:16 p.m. | OK | PyPy 3-64 | TESTS | 4 | 218 | 15155200 | ||
242359852 | RobinFromTheHood | C | Jan. 19, 2024, 12:25 a.m. | OK | PyPy 3-64 | TESTS | 4 | 218 | 19046400 | ||
242323502 | smaheshwari2304 | C | Jan. 18, 2024, 4:45 p.m. | OK | Python 3 | TESTS | 4 | 405 | 14336000 | ||
242334386 | netherfiel | C | Jan. 18, 2024, 5:43 p.m. | OK | Python 3 | TESTS | 4 | 452 | 19660800 | ||
242327598 | pashok1456 | C | Jan. 18, 2024, 5:02 p.m. | OK | Python 3 | TESTS | 4 | 482 | 18432000 | ||
242329090 | ragequitter | C | Jan. 18, 2024, 5:10 p.m. | OK | Python 3 | TESTS | 4 | 483 | 45568000 | ||
242323891 | Kokoa_Chino | C | Jan. 18, 2024, 4:47 p.m. | OK | Python 3 | TESTS | 4 | 545 | 31334400 | ||
242370350 | 231414 | C | Jan. 19, 2024, 3:59 a.m. | OK | Python 3 | TESTS | 4 | 810 | 13619200 | ||
242339195 | chadhurbala | C | Jan. 18, 2024, 6:19 p.m. | OK | Python 3 | TESTS | 4 | 810 | 13619200 | ||
242327437 | bayibo | C | Jan. 18, 2024, 5:01 p.m. | OK | Python 3 | TESTS | 4 | 826 | 20582400 | ||
242363582 | XXJJXJ | C | Jan. 19, 2024, 2:04 a.m. | OK | Python 3 | TESTS | 4 | 826 | 25497600 | ||
242347656 | rajlakehead | C | Jan. 18, 2024, 7:42 p.m. | OK | Python 3 | TESTS | 4 | 842 | 14131200 | ||
242352712 | 0x81 | C | Jan. 18, 2024, 8:55 p.m. | OK | Ruby 3 | TESTS | 4 | 811 | 21196800 | ||
242342624 | teak | C | Jan. 18, 2024, 6:48 p.m. | OK | Rust 2021 | TESTS | 4 | 46 | 11161600 | ||
242345712 | vstiff | C | Jan. 18, 2024, 7:20 p.m. | OK | Rust 2021 | TESTS | 4 | 61 | 5222400 | ||
242348995 | urparvezali | C | Jan. 18, 2024, 7:57 p.m. | OK | Rust 2021 | TESTS | 4 | 857 | 5836800 |
Back to search problems