Codeforces Round 826 (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
1741 Codeforces Round 826 (Div. 3) FINISHED False 8100 71681063 Oct. 11, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2527 ) F Multi-Colored Segments PROGRAMMING binary search data structures math sortings

B'Dmitry has n segments of different colors on the coordinate axis Ox . Each segment is characterized by three integers l_i , r_i and c_i ( 1 <= l_i <= r_i <= 10^9, 1 <= c_i <= n ), where l_i and r_i are are the coordinates of the ends of the i -th segment, and c_i is its color. Dmitry likes to find the minimum distances between segments. However, he considers pairs of segments of the same color uninteresting. Therefore, he wants to know for each segment the distance from this segment to the nearest differently colored segment. The distance between two segments is the minimum of the distances between a point of the first segment and a point of the second segment. In particular, if the segments intersect, then the distance between them is equal to 0 . For example, Dmitry has 5 segments: The first line of the input contains an 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 description of each test case contains one integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of segments. The next n lines contain descriptions of the segments. Each segment is described by three integers l_i , r_i and c_i ( 1 <= l_i <= r_i <= 10^9, 1 <= c_i <= n ) -- coordinates of the left and right ends of i -th segment, as well as the color of this segment. It is guaranteed that there are at least 2 segments of different colors. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, on a separate line print n integers, where the i -th number is equal to the distance from the i -th segment to the nearest segment of a different color. In the first test case of the first sample there is only one segment of color 2 , and all other segments have color 1 . Therefore, for segments of co'...

Tutorials

107908

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
175663370 18tin_nntan F Oct. 11, 2022, 4:59 p.m. OK GNU C++14 TESTS 42 202 7065600
175676949 Tahsin13 F Oct. 11, 2022, 6:56 p.m. OK GNU C++14 TESTS 42 405 10137600
175656999 Hasib_16 F Oct. 11, 2022, 4:41 p.m. OK GNU C++14 TESTS 42 468 23449600
175706839 syksykCCC F Oct. 12, 2022, 4:01 a.m. OK GNU C++14 TESTS 45 655 15462400
175679586 Enfocus F Oct. 11, 2022, 7:27 p.m. OK GNU C++14 TESTS 42 779 16896000
175713501 qqzj F Oct. 12, 2022, 5:27 a.m. OK GNU C++14 TESTS 45 920 26828800
175656339 CoolManGame F Oct. 11, 2022, 4:40 p.m. OK GNU C++14 TESTS 42 982 131584000
175707793 Good_WeekDay_ F Oct. 12, 2022, 4:18 a.m. OK GNU C++14 TESTS 45 997 64102400
175661301 jianq1y F Oct. 11, 2022, 4:49 p.m. OK GNU C++14 TESTS 42 1029 28160000
175702045 SergiiGolovko F Oct. 12, 2022, 2:36 a.m. OK GNU C++14 TESTS 45 1045 9728000
175672077 Bobocan F Oct. 11, 2022, 6:07 p.m. OK GNU C++17 TESTS 42 46 5324800
175704169 SanthoshRN F Oct. 12, 2022, 3:12 a.m. OK GNU C++17 TESTS 45 156 3993600
175666002 walk_alone F Oct. 11, 2022, 5:16 p.m. OK GNU C++17 TESTS 42 187 8806400
175672965 1459007298 F Oct. 11, 2022, 6:16 p.m. OK GNU C++17 TESTS 42 187 13004800
175672770 ATM1459007298 F Oct. 11, 2022, 6:14 p.m. OK GNU C++17 TESTS 42 187 13004800
175702171 NeverS5 F Oct. 12, 2022, 2:38 a.m. OK GNU C++17 TESTS 45 217 11673600
175662331 devil_duck F Oct. 11, 2022, 4:54 p.m. OK GNU C++17 TESTS 42 218 8294400
175715059 Akhil2358 F Oct. 12, 2022, 5:48 a.m. OK GNU C++17 TESTS 45 218 8806400
175658313 BTK F Oct. 11, 2022, 4:44 p.m. OK GNU C++17 TESTS 42 218 11161600
175671851 ATM1459007298 F Oct. 11, 2022, 6:05 p.m. OK GNU C++17 TESTS 42 218 13004800
175705464 Eter.nal F Oct. 12, 2022, 3:35 a.m. OK GNU C++17 (64) TESTS 45 139 7987200
175707838 BlackGuy42 F Oct. 12, 2022, 4:18 a.m. OK GNU C++17 (64) TESTS 45 140 9932800
175658631 Quicksave F Oct. 11, 2022, 4:45 p.m. OK GNU C++17 (64) TESTS 42 186 16076800
175664515 fexla F Oct. 11, 2022, 5:05 p.m. OK GNU C++17 (64) TESTS 42 217 20787200
175657735 bobbytan F Oct. 11, 2022, 4:43 p.m. OK GNU C++17 (64) TESTS 42 233 13721600
175701076 CSUST_GXL F Oct. 12, 2022, 2:17 a.m. OK GNU C++17 (64) TESTS 45 249 14438400
175670028 CSUST_GXL F Oct. 11, 2022, 5:48 p.m. OK GNU C++17 (64) TESTS 42 249 14438400
175658366 coong F Oct. 11, 2022, 4:44 p.m. OK GNU C++17 (64) TESTS 42 249 21504000
175660191 _One_Last_Try F Oct. 11, 2022, 4:48 p.m. OK GNU C++17 (64) TESTS 42 249 30617600
175666733 shekabhi1208 F Oct. 11, 2022, 5:21 p.m. OK GNU C++17 (64) TESTS 42 280 17612800
175668364 jiajieshi F Oct. 11, 2022, 5:34 p.m. OK GNU C++20 (64) TESTS 42 109 8806400
175713874 imoonkin F Oct. 12, 2022, 5:32 a.m. OK GNU C++20 (64) TESTS 45 124 4812800
175707398 UUUnmei F Oct. 12, 2022, 4:10 a.m. OK GNU C++20 (64) TESTS 45 140 8806400
175690175 Satinii F Oct. 11, 2022, 10:42 p.m. OK GNU C++20 (64) TESTS 45 155 17612800
175701630 PERAM_TEJASREE F Oct. 12, 2022, 2:28 a.m. OK GNU C++20 (64) TESTS 45 156 8806400
175679803 Ivan_len F Oct. 11, 2022, 7:29 p.m. OK GNU C++20 (64) TESTS 42 156 17100800
175662337 antoniomsah F Oct. 11, 2022, 4:54 p.m. OK GNU C++20 (64) TESTS 42 156 22732800
175706412 ak_shrana F Oct. 12, 2022, 3:53 a.m. OK GNU C++20 (64) TESTS 45 171 13721600
175679576 sumon123 F Oct. 11, 2022, 7:26 p.m. OK GNU C++20 (64) TESTS 42 202 21913600
175706679 UFFraj4Plrrfm6_jQR F Oct. 12, 2022, 3:58 a.m. OK GNU C++20 (64) TESTS 45 218 15360000
175680927 dpsn743 F Oct. 11, 2022, 7:45 p.m. OK Java 11 TESTS 42 764 6246400
175657395 dzhi F Oct. 11, 2022, 4:42 p.m. OK Java 11 TESTS 42 811 32051200
175663418 profchi F Oct. 11, 2022, 4:59 p.m. OK Java 11 TESTS 42 2402 100659200
175674770 Dukkha F Oct. 11, 2022, 6:33 p.m. OK Java 17 TESTS 42 1185 7270400
175667705 freehandle F Oct. 11, 2022, 5:29 p.m. OK Java 17 TESTS 42 1762 24268800
175690979 invincible777 F Oct. 11, 2022, 11:11 p.m. OK Java 8 TESTS 45 2027 148070400
175705555 cftauros F Oct. 12, 2022, 3:37 a.m. OK Java 8 TESTS 45 2214 117964800
175660725 stopthecount F Oct. 11, 2022, 4:49 p.m. OK Kotlin 1.6 TESTS 42 2245 44748800
175670535 stopthecount F Oct. 11, 2022, 5:52 p.m. OK Kotlin 1.6 TESTS 42 2246 66252800
175670479 stopthecount F Oct. 11, 2022, 5:52 p.m. OK Kotlin 1.6 TESTS 42 2339 66048000
175668584 Kilo_5723 F Oct. 11, 2022, 5:36 p.m. OK MS C++ 2017 TESTS 42 530 11878400
175667576 FishNotebook F Oct. 11, 2022, 5:28 p.m. OK MS C++ 2017 TESTS 42 1107 24268800
175693132 beethoven97 F Oct. 11, 2022, 11:16 p.m. OK PyPy 3-64 TESTS 45 1559 47206400
175691087 beethoven97 F Oct. 11, 2022, 11:15 p.m. OK PyPy 3-64 TESTS 45 1590 47104000
175669984 ZrjaK F Oct. 11, 2022, 5:48 p.m. OK PyPy 3-64 TESTS 42 1762 65433600
175669744 ZrjaK F Oct. 11, 2022, 5:46 p.m. OK PyPy 3-64 TESTS 42 1934 68300800
175675908 ahmedsiad F Oct. 11, 2022, 6:45 p.m. OK PyPy 3-64 TESTS 42 2495 254054400
175688063 titia F Oct. 11, 2022, 9:45 p.m. OK PyPy 3-64 TESTS 42 2667 203673600
175702675 klucse2000030318 F Oct. 12, 2022, 2:47 a.m. OK Python 3 TESTS 45 1684 36249600
175701760 DhirishalaLavanya F Oct. 12, 2022, 2:30 a.m. OK Python 3 TESTS 45 1699 36249600
175665470 zaphar F Oct. 11, 2022, 5:12 p.m. OK Python 3 TESTS 42 1731 36249600
175660954 PMiguelez F Oct. 11, 2022, 4:49 p.m. OK Python 3 TESTS 42 1731 36249600

remove filters

Back to search problems