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 |
---|---|---|---|---|---|---|
1635 | Codeforces Round 772 (Div. 2) | FINISHED | False | 7200 | 91898663 | Feb. 20, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1153 ) | F | Closest Pair | PROGRAMMING | data structures greedy |
B'There are n weighted points on the OX -axis. The coordinate and the weight of the i -th point is x_i and w_i , respectively. All points have distinct coordinates and positive weights. Also, x_i < x_{i + 1} holds for any 1 <= q i < n . The weighted distance between i -th point and j -th point is defined as |x_i - x_j| cdot (w_i + w_j) , where |val| denotes the absolute value of val . You should answer q queries, where the i -th query asks the following: Find the minimum weighted distance among all pairs of distinct points among the points in subarray [l_i,r_i] . The first line contains 2 integers n and q (2 <= q n <= q 3 cdot 10^5; 1 <= q q <= q 3 cdot 10^5) -- the number of points and the number of queries. Then, n lines follows, the i -th of them contains two integers x_i and w_i (-10^9 <= q x_i <= q 10^9; 1 <= q w_i <= q 10^9) -- the coordinate and the weight of the i -th point. It is guaranteed that the points are given in the increasing order of x . Then, q lines follows, the i -th of them contains two integers l_i and r_i (1 <= q l_i < r_i <= q n) -- the given subarray of the i -th query. For each query output one integer, the minimum weighted distance among all pair of distinct points in the given subarray. For the first query, the minimum weighted distance is between points 1 and 3 , which is equal to |x_1 - x_3| cdot (w_1 + w_3) = |-2 - 1| cdot (2 + 1) = 9 . For the second query, the minimum weighted distance is between points 2 and 3 , which is equal to |x_2 - x_3| cdot (w_2 + w_3) = |0 - 1| cdot (10 + 1) = 11 . For the fourth query, the minimum weighted distance is between points 3 and 4 , which is equal to |x_3 - x_4| cdot (w_3 + w_4) = |1 - 9| cdot (1 + 2) = 24 . '... |
Codeforces Round #772 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
147119219 | KrK | F | Feb. 20, 2022, 9:28 p.m. | OK | GNU C++14 | TESTS | 68 | 421 | 18227200 | ||
147131254 | XZC__Bobby | F | Feb. 21, 2022, 2:58 a.m. | OK | GNU C++14 | TESTS | 68 | 452 | 22016000 | ||
147125953 | Flower_Yang | F | Feb. 21, 2022, 12:49 a.m. | OK | GNU C++14 | TESTS | 68 | 467 | 27955200 | ||
147126576 | Tyyyyyy | F | Feb. 21, 2022, 1:12 a.m. | OK | GNU C++14 | TESTS | 68 | 498 | 26931200 | ||
147129718 | retah | F | Feb. 21, 2022, 2:42 a.m. | OK | GNU C++14 | TESTS | 68 | 545 | 25702400 | ||
147121916 | fbabic | F | Feb. 20, 2022, 10:34 p.m. | OK | GNU C++14 | TESTS | 68 | 592 | 49664000 | ||
147128848 | L7-56 | F | Feb. 21, 2022, 2:21 a.m. | OK | GNU C++14 | TESTS | 68 | 607 | 72192000 | ||
147133154 | suxxsfe | F | Feb. 21, 2022, 3:36 a.m. | OK | GNU C++14 | TESTS | 68 | 670 | 24371200 | ||
147129732 | Shinta | F | Feb. 21, 2022, 2:43 a.m. | OK | GNU C++14 | TESTS | 68 | 686 | 47308800 | ||
147126890 | fengzhengwei | F | Feb. 21, 2022, 1:22 a.m. | OK | GNU C++14 | TESTS | 68 | 717 | 26931200 | ||
147130985 | DerekFeng | F | Feb. 21, 2022, 2:53 a.m. | OK | GNU C++17 | TESTS | 68 | 498 | 26419200 | ||
147106776 | Noureldin | F | Feb. 20, 2022, 6:25 p.m. | OK | GNU C++17 | TESTS | 68 | 514 | 62873600 | ||
147104275 | zech | F | Feb. 20, 2022, 6:04 p.m. | OK | GNU C++17 | TESTS | 68 | 545 | 33792000 | ||
147103776 | Ji_Kuai | F | Feb. 20, 2022, 6:01 p.m. | OK | GNU C++17 | TESTS | 68 | 561 | 23961600 | ||
147126620 | Waimai | F | Feb. 21, 2022, 1:13 a.m. | OK | GNU C++17 | TESTS | 68 | 592 | 37580800 | ||
147119119 | peti1234 | F | Feb. 20, 2022, 9:26 p.m. | OK | GNU C++17 | TESTS | 68 | 639 | 39424000 | ||
147091006 | wifiiii | F | Feb. 20, 2022, 4:17 p.m. | OK | GNU C++17 | TESTS | 68 | 686 | 72294400 | ||
147116194 | Nyaruko | F | Feb. 20, 2022, 8:30 p.m. | OK | GNU C++17 | TESTS | 68 | 717 | 54169600 | ||
147093958 | lucaperju | F | Feb. 20, 2022, 4:25 p.m. | OK | GNU C++17 | TESTS | 68 | 764 | 39731200 | ||
147117130 | Tiagodfs | F | Feb. 20, 2022, 8:46 p.m. | OK | GNU C++17 | TESTS | 68 | 779 | 84684800 | ||
147121608 | kotatsugame | F | Feb. 20, 2022, 10:26 p.m. | OK | GNU C++17 (64) | TESTS | 68 | 390 | 31436800 | ||
147123281 | cheissmart | F | Feb. 20, 2022, 11:17 p.m. | OK | GNU C++17 (64) | TESTS | 68 | 420 | 33382400 | ||
147127894 | kimoyami | F | Feb. 21, 2022, 1:55 a.m. | OK | GNU C++17 (64) | TESTS | 68 | 421 | 44953600 | ||
147102178 | rainboy | F | Feb. 20, 2022, 5:52 p.m. | OK | GNU C++17 (64) | TESTS | 68 | 436 | 26316800 | ||
147115261 | moo. | F | Feb. 20, 2022, 8:13 p.m. | OK | GNU C++17 (64) | TESTS | 68 | 436 | 41984000 | ||
147107808 | haruki_K | F | Feb. 20, 2022, 6:34 p.m. | OK | GNU C++17 (64) | TESTS | 68 | 468 | 46080000 | ||
147127739 | yzy1 | F | Feb. 21, 2022, 1:50 a.m. | OK | GNU C++17 (64) | TESTS | 68 | 483 | 106496000 | ||
147117475 | Vax | F | Feb. 20, 2022, 8:53 p.m. | OK | GNU C++17 (64) | TESTS | 68 | 498 | 75571200 | ||
147124892 | froggyzhang | F | Feb. 21, 2022, 12:13 a.m. | OK | GNU C++17 (64) | TESTS | 68 | 561 | 44953600 | ||
147126770 | Ronnie007 | F | Feb. 21, 2022, 1:18 a.m. | OK | GNU C++17 (64) | TESTS | 68 | 577 | 56115200 | ||
147135562 | keenlf | F | Feb. 21, 2022, 4:20 a.m. | OK | GNU C++20 (64) | TESTS | 68 | 296 | 25497600 | ||
147124521 | sum | F | Feb. 21, 2022, midnight | OK | GNU C++20 (64) | TESTS | 68 | 327 | 32972800 | ||
147129403 | BurnoutAg7 | F | Feb. 21, 2022, 2:35 a.m. | OK | GNU C++20 (64) | TESTS | 68 | 327 | 33075200 | ||
147101520 | LeoPro | F | Feb. 20, 2022, 5:49 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 343 | 33484800 | ||
147111066 | JocalAreaNetwork | F | Feb. 20, 2022, 7:12 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 358 | 33484800 | ||
147105436 | tute7627 | F | Feb. 20, 2022, 6:13 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 358 | 35328000 | ||
147131269 | tataredmi | F | Feb. 21, 2022, 2:58 a.m. | OK | GNU C++20 (64) | TESTS | 68 | 358 | 36864000 | ||
147109527 | huangxiaohua | F | Feb. 20, 2022, 6:53 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 358 | 37478400 | ||
147114088 | Koosha_Mv | F | Feb. 20, 2022, 7:55 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 358 | 49868800 | ||
147109686 | huangxiaohua | F | Feb. 20, 2022, 6:55 p.m. | OK | GNU C++20 (64) | TESTS | 68 | 373 | 37478400 |
Back to search problems