Codeforces Round 951 (Div. 2)

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
1979 Codeforces Round 951 (Div. 2) FINISHED False 7200 19495463 June 6, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1508 ) E Manhattan Triangle PROGRAMMING binary search constructive algorithms data structures geometry graphs two pointers

B'The Manhattan distance between two points (x_1, y_1) and (x_2, y_2) is defined as: |x_1 - x_2| + |y_1 - y_2|. We call a Manhattan triangle three points on the plane, the Manhattan distances between each pair of which are equal. You are given a set of pairwise distinct points and an even integer d . Your task is to find any Manhattan triangle, composed of three distinct points from the given set, where the Manhattan distance between any pair of vertices is equal to d . Each test consists of multiple test cases. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and d ( 3 <= n <= 2 cdot 10^5 , 2 <= d <= 4 cdot 10^5 , d is even) -- the number of points and the required Manhattan distance between the vertices of the triangle. The (i + 1) -th line of each test case contains two integers x_i and y_i ( -10^5 <= x_i, y_i <= 10^5 ) -- the coordinates of the i -th point. It is guaranteed that all points are pairwise distinct. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output three distinct integers i , j , and k ( 1 <= i,j,k <= n ) -- the indices of the points forming the Manhattan triangle. If there is no solution, output " 0 0 0 " (without quotes). If there are multiple solutions, output any of them. In the first test case: In the third test case: In the fourth test case, there are no two points with a Manhattan distance of 4 , and therefore there is no suitable Manhattan triangle. '...

Tutorials

Codeforces Round 951 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
264535975 lishiao3405 E June 7, 2024, 4:05 a.m. OK C++14 (GCC 6-32) TESTS 31 234 11366400
264535930 lishiao3405 E June 7, 2024, 4:04 a.m. OK C++14 (GCC 6-32) TESTS 31 265 11366400
264530588 Hanoist E June 7, 2024, 2:51 a.m. OK C++14 (GCC 6-32) TESTS 31 343 21299200
264542549 LG805653 E June 7, 2024, 5:15 a.m. OK C++14 (GCC 6-32) TESTS 31 358 6656000
264492780 liujg E June 6, 2024, 5:20 p.m. OK C++14 (GCC 6-32) TESTS 25 406 21811200
264503495 pratham.programming7 E June 6, 2024, 6:33 p.m. OK C++14 (GCC 6-32) TESTS 28 514 30105600
264537241 llzer E June 7, 2024, 4:20 a.m. OK C++14 (GCC 6-32) TESTS 31 593 42188800
264493310 Ijichi_Nijika E June 6, 2024, 5:22 p.m. OK C++14 (GCC 6-32) TESTS 25 608 19456000
264537614 david_tao E June 7, 2024, 4:23 a.m. OK C++14 (GCC 6-32) TESTS 31 640 16179200
264539657 heaksicn E June 7, 2024, 4:46 a.m. OK C++14 (GCC 6-32) TESTS 31 671 36966400
264495539 Actium E June 6, 2024, 5:33 p.m. OK C++17 (GCC 7-32) TESTS 26 202 8396800
264525818 wangck1998 E June 7, 2024, 1:28 a.m. OK C++17 (GCC 7-32) TESTS 28 203 0
264542526 Yue_chen E June 7, 2024, 5:14 a.m. OK C++17 (GCC 7-32) TESTS 31 234 6656000
264533816 MintCat E June 7, 2024, 3:36 a.m. OK C++17 (GCC 7-32) TESTS 31 249 7168000
264533065 VitaLemonTea E June 7, 2024, 3:25 a.m. OK C++17 (GCC 7-32) TESTS 31 250 3276800
264520974 AksLolCoding E June 6, 2024, 11:21 p.m. OK C++17 (GCC 7-32) TESTS 28 264 14438400
264546663 yuan-shen E June 7, 2024, 5:54 a.m. OK C++17 (GCC 7-32) TESTS 31 265 14233600
264539477 mingjunyi1024helloworld E June 7, 2024, 4:44 a.m. OK C++17 (GCC 7-32) TESTS 31 296 6656000
264534575 mingjunyi1024helloworld E June 7, 2024, 3:47 a.m. OK C++17 (GCC 7-32) TESTS 31 296 6656000
264492536 cwz2024 E June 6, 2024, 5:19 p.m. OK C++17 (GCC 7-32) TESTS 25 311 7987200
264528011 PedroGallo E June 7, 2024, 2:11 a.m. OK C++20 (GCC 13-64) TESTS 29 186 0
264512969 tumu1t E June 6, 2024, 8:28 p.m. OK C++20 (GCC 13-64) TESTS 28 203 11776000
264528122 abbcc__1 E June 7, 2024, 2:13 a.m. OK C++20 (GCC 13-64) TESTS 29 217 6656000
264533148 LNian E June 7, 2024, 3:27 a.m. OK C++20 (GCC 13-64) TESTS 31 218 6656000
264503463 Ashish_Jha_ E June 6, 2024, 6:33 p.m. OK C++20 (GCC 13-64) TESTS 28 218 6656000
264534710 LiuXingJian E June 7, 2024, 3:48 a.m. OK C++20 (GCC 13-64) TESTS 31 218 10137600
264502989 korokseeds E June 6, 2024, 6:29 p.m. OK C++20 (GCC 13-64) TESTS 28 218 10854400
264502851 korokseeds E June 6, 2024, 6:27 p.m. OK C++20 (GCC 13-64) TESTS 28 218 10854400
264501933 korokseeds E June 6, 2024, 6:20 p.m. OK C++20 (GCC 13-64) TESTS 28 218 10854400
264494687 -.--..-..... E June 6, 2024, 5:29 p.m. OK C++20 (GCC 13-64) TESTS 26 233 3788800
264528425 nguyenquocthao00 E June 7, 2024, 2:18 a.m. OK Go TESTS 29 359 68505600
264533872 nguyenquocthao00 E June 7, 2024, 3:37 a.m. OK Go TESTS 31 452 62361600
264525986 KYNick E June 7, 2024, 1:32 a.m. OK Java 21 TESTS 28 1312 84992000
264526449 KYNick E June 7, 2024, 1:42 a.m. OK Java 21 TESTS 28 1343 67891200
264521297 dzhi E June 6, 2024, 11:31 p.m. OK Java 21 TESTS 28 1484 140288000
264524904 cc4414 E June 7, 2024, 1:09 a.m. OK Java 21 TESTS 28 2296 261836800
264518159 Shaykhutdinov-T-I E June 6, 2024, 9:55 p.m. OK Java 8 TESTS 28 1796 137011200
264520062 invincible777 E June 6, 2024, 10:49 p.m. OK Java 8 TESTS 28 2749 79564800
264505113 misorin E June 6, 2024, 6:51 p.m. OK PyPy 3-64 TESTS 28 593 44339200
264524899 smilences E June 7, 2024, 1:09 a.m. OK PyPy 3-64 TESTS 28 639 110182400
264524366 smilences E June 7, 2024, 12:56 a.m. OK PyPy 3-64 TESTS 28 639 110489600
264505809 misorin E June 6, 2024, 6:58 p.m. OK PyPy 3-64 TESTS 28 640 44032000
264492908 Little_Sheep_Yawn E June 6, 2024, 5:20 p.m. OK PyPy 3-64 TESTS 25 655 95641600
264523334 liupengsay E June 7, 2024, 12:29 a.m. OK PyPy 3-64 TESTS 28 671 78028800
264516962 Mitttel E June 6, 2024, 9:31 p.m. OK PyPy 3-64 TESTS 28 749 86323200
264493154 Acceon E June 6, 2024, 5:21 p.m. OK PyPy 3-64 TESTS 25 796 86323200
264534453 hxu10 E June 7, 2024, 3:45 a.m. OK PyPy 3-64 TESTS 31 843 96768000
264522998 liupengsay E June 7, 2024, 12:20 a.m. OK PyPy 3-64 TESTS 28 874 76288000
264513315 connorencrypted E June 6, 2024, 8:33 p.m. OK Python 3 TESTS 28 765 63283200
264516602 kost E June 6, 2024, 9:25 p.m. OK Rust 2021 TESTS 28 327 62668800
264502304 sky E June 6, 2024, 6:23 p.m. OK Rust 2021 TESTS 28 343 37478400

remove filters

Back to search problems