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 |
---|---|---|---|---|---|---|
1450 | Codeforces Global Round 12 | FINISHED | False | 10800 | 124557899 | Dec. 6, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 15212 ) | B | Balls of Steel | PROGRAMMING | brute force geometry greedy |
B"You have n distinct points (x_1, y_1), ldots,(x_n,y_n) on the plane and a non-negative integer parameter k . Each point is a microscopic steel ball and k is the attract power of a ball when it's charged. The attract power is the same for all balls. In one operation, you can select a ball i to charge it. Once charged, all balls with Manhattan distance at most k from ball i move to the position of ball i . Many balls may have the same coordinate after an operation. More formally, for all balls j such that |x_i - x_j| + |y_i - y_j| <= k , we assign x_j:=x_i and y_j:=y_i . Your task is to find the minimum number of operations to move all balls to the same position, or report that this is impossible. The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The first line of each test case contains two integers n , k ( 2 <= n <= 100 , 0 <= k <= 10^6 ) -- the number of balls and the attract power of all balls, respectively. The following n lines describe the balls' coordinates. The i -th of these lines contains two integers x_i , y_i ( 0 <= x_i, y_i <= 10^5 ) -- the coordinates of the i -th ball. It is guaranteed that all points are distinct. For each test case print a single integer -- the minimum number of operations to move all balls to the same position, or -1 if it is impossible. In the first test case, there are three balls at (0, 0) , (3, 3) , and (1, 1) and the attract power is 2 . It is possible to move two balls together with one operation, but not all three balls together with any number of operations. In the second test case, there are three balls at (6, 7) , (8, 8) , and (6, 9) and the attract power is 3 . If we charge any ball, the other two will move to the same position, so we only require one operation. In the third test ca"... |
Codeforces Global Round 12 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
100578357 | ntat000 | B | Dec. 6, 2020, 5:23 p.m. | OK | FPC | TESTS | 50 | 31 | 0 | ||
100599344 | BugLeave | B | Dec. 7, 2020, 4:33 a.m. | OK | GNU C11 | TESTS | 50 | 31 | 0 | ||
100568576 | codor07 | B | Dec. 6, 2020, 4:29 p.m. | OK | GNU C11 | TESTS | 50 | 31 | 0 | ||
100592894 | sameer.g2347 | B | Dec. 6, 2020, 11:53 p.m. | OK | GNU C11 | TESTS | 50 | 31 | 0 | ||
100577159 | k4m1k4ze | B | Dec. 6, 2020, 5:16 p.m. | OK | GNU C11 | TESTS | 50 | 31 | 0 | ||
100574223 | Ankit0403 | B | Dec. 6, 2020, 5 p.m. | OK | GNU C11 | TESTS | 50 | 31 | 0 | ||
100585262 | manish_1605 | B | Dec. 6, 2020, 7:05 p.m. | OK | GNU C11 | TESTS | 50 | 31 | 307200 | ||
100569143 | Sazib_Hossain | B | Dec. 6, 2020, 4:32 p.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100596833 | bu_zhi | B | Dec. 7, 2020, 3:13 a.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100595572 | I_Love_Sakurajima_Mai | B | Dec. 7, 2020, 2:28 a.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100593561 | RainAir | B | Dec. 7, 2020, 12:38 a.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100591178 | up_to_sun | B | Dec. 6, 2020, 10:08 p.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100587916 | Cadenza | B | Dec. 6, 2020, 8:09 p.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100587739 | smit_ | B | Dec. 6, 2020, 8:04 p.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100574117 | Manuelmm | B | Dec. 6, 2020, 4:59 p.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100598277 | wbscd | B | Dec. 7, 2020, 4:03 a.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100596945 | gswsc30 | B | Dec. 7, 2020, 3:18 a.m. | OK | GNU C++11 | TESTS | 50 | 31 | 0 | ||
100599369 | _rishab_kulkarni | B | Dec. 7, 2020, 4:33 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100597892 | ytwiz | B | Dec. 7, 2020, 3:50 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100597855 | astronomia | B | Dec. 7, 2020, 3:49 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100597777 | Xy9px | B | Dec. 7, 2020, 3:47 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100595745 | ojhaakshat | B | Dec. 7, 2020, 2:35 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100594754 | bonaventuragal | B | Dec. 7, 2020, 1:52 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100602366 | deepakpra | B | Dec. 7, 2020, 5:43 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100603123 | oneAboveAll | B | Dec. 7, 2020, 5:59 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100600551 | saurav1717 | B | Dec. 7, 2020, 5:04 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100599859 | Newplayers123 | B | Dec. 7, 2020, 4:46 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 0 | ||
100601430 | dishantsethi1 | B | Dec. 7, 2020, 5:23 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100603187 | Tsovak | B | Dec. 7, 2020, 6 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100602983 | i_m_arin | B | Dec. 7, 2020, 5:55 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100602880 | _lamia_ | B | Dec. 7, 2020, 5:53 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100602397 | daniel071292 | B | Dec. 7, 2020, 5:44 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100602032 | sueelkumar | B | Dec. 7, 2020, 5:36 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100600528 | SAURABH.DADHICH | B | Dec. 7, 2020, 5:03 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100600299 | ml_coder | B | Dec. 7, 2020, 4:57 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100599688 | maycod23 | B | Dec. 7, 2020, 4:41 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100599685 | Asterix_29 | B | Dec. 7, 2020, 4:41 a.m. | OK | GNU C++17 | TESTS | 50 | 31 | 0 | ||
100595525 | vioalbert | B | Dec. 7, 2020, 2:25 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 30 | 0 | ||
100600720 | sammyMaX | B | Dec. 7, 2020, 5:08 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100600071 | bear_45 | B | Dec. 7, 2020, 4:51 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100598701 | vahbuna_ | B | Dec. 7, 2020, 4:16 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100598569 | Pandemic | B | Dec. 7, 2020, 4:12 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100601354 | jericoder | B | Dec. 7, 2020, 5:22 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100601372 | gameofcodes | B | Dec. 7, 2020, 5:22 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100601556 | i_o__o_i | B | Dec. 7, 2020, 5:26 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100601769 | tepamid | B | Dec. 7, 2020, 5:31 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100598564 | idsigma | B | Dec. 7, 2020, 4:12 a.m. | OK | GNU C++17 (64) | TESTS | 50 | 31 | 0 | ||
100583069 | litesam | B | Dec. 6, 2020, 6:32 p.m. | OK | Java 11 | TESTS | 50 | 187 | 0 | ||
100599631 | bishal141119 | B | Dec. 7, 2020, 4:40 a.m. | OK | Java 11 | TESTS | 50 | 187 | 0 | ||
100594638 | yuruiyin | B | Dec. 7, 2020, 1:45 a.m. | OK | Java 11 | TESTS | 50 | 187 | 0 | ||
100587956 | RuthlessAggression | B | Dec. 6, 2020, 8:10 p.m. | OK | Java 11 | TESTS | 50 | 187 | 0 | ||
100585505 | insert_cool_handle | B | Dec. 6, 2020, 7:08 p.m. | OK | Java 11 | TESTS | 50 | 187 | 0 | ||
100572382 | remain_calm | B | Dec. 6, 2020, 4:50 p.m. | OK | Java 11 | TESTS | 50 | 187 | 0 | ||
100589338 | abdelrahman-yousf | B | Dec. 6, 2020, 8:53 p.m. | OK | Java 11 | TESTS | 50 | 202 | 0 | ||
100585659 | gssakash | B | Dec. 6, 2020, 7:11 p.m. | OK | Java 11 | TESTS | 50 | 202 | 0 | ||
100585216 | pgthebigshot | B | Dec. 6, 2020, 7:04 p.m. | OK | Java 11 | TESTS | 50 | 202 | 0 | ||
100584470 | gssakash | B | Dec. 6, 2020, 6:52 p.m. | OK | Java 11 | TESTS | 50 | 202 | 0 | ||
100593923 | hassanU | B | Dec. 7, 2020, 1:01 a.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100593135 | xoszm | B | Dec. 7, 2020, 12:09 a.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100592595 | Digvijaysingh0707 | B | Dec. 6, 2020, 11:33 p.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100592431 | Digvijaysingh0707 | B | Dec. 6, 2020, 11:21 p.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100590880 | irazvi1890 | B | Dec. 6, 2020, 9:52 p.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100586728 | ashraf101 | B | Dec. 6, 2020, 7:36 p.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100587754 | coolManit | B | Dec. 6, 2020, 8:04 p.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100582895 | Andrisovich | B | Dec. 6, 2020, 6:30 p.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100598380 | yashpandey73 | B | Dec. 7, 2020, 4:06 a.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100598282 | Bodz204 | B | Dec. 7, 2020, 4:03 a.m. | OK | Java 8 | TESTS | 50 | 124 | 0 | ||
100572642 | krishna776 | B | Dec. 6, 2020, 4:51 p.m. | OK | JavaScript | TESTS | 50 | 77 | 3379200 | ||
100596062 | Spheniscine | B | Dec. 7, 2020, 2:47 a.m. | OK | Kotlin | TESTS | 50 | 124 | 0 | ||
100587608 | Dev.Zaki | B | Dec. 6, 2020, 8 p.m. | OK | Kotlin | TESTS | 50 | 186 | 102400 | ||
100583019 | amelentev | B | Dec. 6, 2020, 6:31 p.m. | OK | Kotlin | TESTS | 50 | 187 | 1945600 | ||
100579269 | dustnehowl | B | Dec. 6, 2020, 5:28 p.m. | OK | MS C++ | TESTS | 50 | 46 | 0 | ||
100580191 | krishnayadav1 | B | Dec. 6, 2020, 5:32 p.m. | OK | MS C++ | TESTS | 50 | 46 | 0 | ||
100597216 | sy20190441030 | B | Dec. 7, 2020, 3:26 a.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 0 | ||
100566761 | Darisishe | B | Dec. 6, 2020, 4:21 p.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 0 | ||
100598851 | saarth11 | B | Dec. 7, 2020, 4:20 a.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 0 | ||
100598685 | sskhynix | B | Dec. 7, 2020, 4:15 a.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 0 | ||
100583129 | Gravekper | B | Dec. 6, 2020, 6:32 p.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 0 | ||
100584160 | gaserashraf | B | Dec. 6, 2020, 6:47 p.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 819200 | ||
100583794 | Xeniya | B | Dec. 6, 2020, 6:42 p.m. | OK | MS C++ 2017 | TESTS | 50 | 46 | 1638400 | ||
100566700 | QaZEdCTgB | B | Dec. 6, 2020, 4:20 p.m. | OK | MS C++ 2017 | TESTS | 50 | 61 | 204800 | ||
100577415 | tomvai15 | B | Dec. 6, 2020, 5:18 p.m. | OK | .NET Core C# | TESTS | 50 | 109 | 2662400 | ||
100578557 | ansergeyg | B | Dec. 6, 2020, 5:24 p.m. | OK | .NET Core C# | TESTS | 50 | 109 | 3379200 | ||
100601823 | wqt_ | B | Dec. 7, 2020, 5:32 a.m. | OK | Node.js | TESTS | 50 | 140 | 5120000 | ||
100598181 | Gaurav1 | B | Dec. 7, 2020, 4 a.m. | OK | PyPy 2 | TESTS | 50 | 218 | 6860800 | ||
100574148 | aberent | B | Dec. 6, 2020, 4:59 p.m. | OK | PyPy 3 | TESTS | 50 | 187 | 2969600 | ||
100565639 | chirag_j_rana | B | Dec. 6, 2020, 4:15 p.m. | OK | PyPy 3 | TESTS | 50 | 187 | 5222400 | ||
100586382 | gintoki_s | B | Dec. 6, 2020, 7:27 p.m. | OK | PyPy 3 | TESTS | 50 | 202 | 3584000 | ||
100575231 | DarkOverlord999 | B | Dec. 6, 2020, 5:06 p.m. | OK | PyPy 3 | TESTS | 50 | 202 | 4198400 | ||
100583491 | apurva3455 | B | Dec. 6, 2020, 6:37 p.m. | OK | PyPy 3 | TESTS | 50 | 218 | 4710400 | ||
100600593 | shubh1815 | B | Dec. 7, 2020, 5:05 a.m. | OK | PyPy 3 | TESTS | 50 | 233 | 4096000 | ||
100569988 | Son__goku__ | B | Dec. 6, 2020, 4:37 p.m. | OK | PyPy 3 | TESTS | 50 | 233 | 4403200 | ||
100587562 | kushagramanojgupta | B | Dec. 6, 2020, 7:59 p.m. | OK | PyPy 3 | TESTS | 50 | 233 | 5017600 | ||
100594273 | Coki628 | B | Dec. 7, 2020, 1:22 a.m. | OK | PyPy 3 | TESTS | 50 | 234 | 3993600 | ||
100599867 | Death_17 | B | Dec. 7, 2020, 4:46 a.m. | OK | PyPy 3 | TESTS | 50 | 249 | 4608000 | ||
100601664 | ap1008 | B | Dec. 7, 2020, 5:29 a.m. | OK | Python 2 | TESTS | 50 | 202 | 102400 | ||
100595025 | biltharesatyendra | B | Dec. 7, 2020, 2:05 a.m. | OK | Python 2 | TESTS | 50 | 514 | 0 | ||
100601806 | skate1512 | B | Dec. 7, 2020, 5:31 a.m. | OK | Python 3 | TESTS | 50 | 155 | 307200 | ||
100602933 | shashanks1419 | B | Dec. 7, 2020, 5:54 a.m. | OK | Python 3 | TESTS | 50 | 156 | 0 | ||
100603190 | Constable | B | Dec. 7, 2020, 6 a.m. | OK | Python 3 | TESTS | 50 | 156 | 307200 | ||
100565808 | Mortus | B | Dec. 6, 2020, 4:16 p.m. | OK | Python 3 | TESTS | 50 | 156 | 307200 | ||
100573629 | Yakser | B | Dec. 6, 2020, 4:56 p.m. | OK | Python 3 | TESTS | 50 | 171 | 307200 | ||
100599796 | codingkick | B | Dec. 7, 2020, 4:43 a.m. | OK | Python 3 | TESTS | 50 | 171 | 307200 | ||
100594347 | DarkHeart861 | B | Dec. 7, 2020, 1:27 a.m. | OK | Python 3 | TESTS | 50 | 171 | 307200 | ||
100582531 | pakshi_141199 | B | Dec. 6, 2020, 6:27 p.m. | OK | Python 3 | TESTS | 50 | 171 | 307200 | ||
100578882 | rohith_keshetti | B | Dec. 6, 2020, 5:26 p.m. | OK | Python 3 | TESTS | 50 | 171 | 307200 | ||
100573281 | surajajaydwivedi | B | Dec. 6, 2020, 4:55 p.m. | OK | Python 3 | TESTS | 50 | 171 | 307200 |
Back to search problems