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.
Problems
B'There are n pairwise-distinct points and a line x+y=k on a two-dimensional plane. The i -th point is at (x_i,y_i) . All points have non-negative coordinates and are strictly below the line. Alternatively, 0 <= q x_i,y_i, x_i+y_i < k . Tenzing wants to erase all the points. He can perform the following two operations: The blue area of the following picture describes the triangle with a=1,b=1 with cost =1 cdot A . Help Tenzing find the minimum cost to erase all of the points. The first line of the input contains three integers n , k and A ( 1 <= q n,k <= q 2 cdot 10^5 , 1 <= q A <= q 10^4 ) -- the number of points, the coefficient describing the hypotenuse of the triangle and the coefficient describing the cost of drawing a triangle. The following n lines of the input the i -th line contains three integers x_i,y_i,c_i ( 0 <= q x_i,y_i,x_i+y_i< k , 1 <= q c_i <= q 10^4 ) -- the coordinate of the i -th points and the cost of erasing it using the second operation. It is guaranteed that the coordinates are pairwise distinct. Output a single integer --the minimum cost needed to erase all of the points. The picture of the first example: Tenzing do the following operations: The picture of the second example: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
210968251 |
rainboy |
E |
June 24, 2023, 8:35 p.m. |
OK |
GNU C11 |
TESTS |
22 |
233 |
22425600 |
|
|
210940287 |
chro4896 |
E |
June 24, 2023, 4:25 p.m. |
OK |
GNU C11 |
TESTS |
22 |
421 |
10752000 |
|
|
210934905 |
pengyule |
E |
June 24, 2023, 4:07 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
156 |
24268800 |
|
|
210979545 |
Sol1 |
E |
June 25, 2023, 12:49 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
202 |
26316800 |
|
|
210985718 |
zhouyuheng2009 |
E |
June 25, 2023, 3:31 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
249 |
15462400 |
|
|
210986028 |
an_interesting_name |
E |
June 25, 2023, 3:38 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
249 |
24166400 |
|
|
210945811 |
-LAP- |
E |
June 24, 2023, 4:47 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
249 |
25804800 |
|
|
210937629 |
Potassium |
E |
June 24, 2023, 4:16 p.m. |
OK |
GNU C++14 |
TESTS |
22 |
280 |
14540800 |
|
|
210985020 |
fjashufi |
E |
June 25, 2023, 3:14 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
280 |
23244800 |
|
|
210992600 |
yzb002 |
E |
June 25, 2023, 5:51 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
311 |
28876800 |
|
|
210986113 |
an_interesting_name |
E |
June 25, 2023, 3:40 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
312 |
19251200 |
|
|
210980883 |
dengziyue |
E |
June 25, 2023, 1:26 a.m. |
OK |
GNU C++14 |
TESTS |
22 |
342 |
32256000 |
|
|
210986170 |
HarperTaylor |
E |
June 25, 2023, 3:42 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
187 |
8806400 |
|
|
210986078 |
Sisu |
E |
June 25, 2023, 3:39 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
217 |
36044800 |
|
|
210949995 |
NEU20133823 |
E |
June 24, 2023, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
249 |
9625600 |
|
|
210941534 |
EmeraldBlock |
E |
June 24, 2023, 4:30 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
249 |
11366400 |
|
|
210976631 |
radoslav11 |
E |
June 24, 2023, 11:23 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
264 |
40243200 |
|
|
210946245 |
lintd |
E |
June 24, 2023, 4:49 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
264 |
67686400 |
|
|
210982986 |
1.618 |
E |
June 25, 2023, 2:23 a.m. |
OK |
GNU C++17 |
TESTS |
22 |
265 |
13619200 |
|
|
210945270 |
laelovatsug |
E |
June 24, 2023, 4:45 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
265 |
25804800 |
|
|
210940084 |
IanDeHaan |
E |
June 24, 2023, 4:24 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
265 |
28262400 |
|
|
210942860 |
NKheyuxiang |
E |
June 24, 2023, 4:35 p.m. |
OK |
GNU C++17 |
TESTS |
22 |
280 |
22630400 |
|
|
210982947 |
neal |
E |
June 25, 2023, 2:22 a.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
202 |
19763200 |
|
|
210991116 |
YXH_XianYu |
E |
June 25, 2023, 5:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
202 |
43724800 |
|
|
210955435 |
drdilyor |
E |
June 24, 2023, 6:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
233 |
23347200 |
|
|
210946207 |
maomao90 |
E |
June 24, 2023, 4:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
233 |
42496000 |
|
|
210991072 |
YXH_XianYu |
E |
June 25, 2023, 5:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
233 |
43724800 |
|
|
210942121 |
GoatTamer |
E |
June 24, 2023, 4:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
234 |
23347200 |
|
|
210935660 |
yzc2005 |
E |
June 24, 2023, 4:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
248 |
24883200 |
|
|
210948238 |
SanweiTreap |
E |
June 24, 2023, 4:57 p.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
248 |
26726400 |
|
|
210991405 |
YXH_XianYu |
E |
June 25, 2023, 5:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
248 |
43724800 |
|
|
210946039 |
zyxoi |
E |
June 24, 2023, 4:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
22 |
249 |
16896000 |
|
|
210950383 |
zqyyy |
E |
June 24, 2023, 5:04 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
140 |
27955200 |
|
|
210954574 |
ajpiano |
E |
June 24, 2023, 6:03 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
171 |
22528000 |
|
|
210986221 |
DennisTran |
E |
June 25, 2023, 3:43 a.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
187 |
26726400 |
|
|
210955713 |
Meloric |
E |
June 24, 2023, 6:11 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
202 |
19353600 |
|
|
210947052 |
YaKei |
E |
June 24, 2023, 4:52 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
202 |
28876800 |
|
|
210934996 |
fmota |
E |
June 24, 2023, 4:07 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
202 |
47513600 |
|
|
210959421 |
anton_h |
E |
June 24, 2023, 6:44 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
217 |
17715200 |
|
|
210941786 |
AmShZ |
E |
June 24, 2023, 4:30 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
218 |
15360000 |
|
|
210958490 |
maxplus |
E |
June 24, 2023, 6:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
218 |
17612800 |
|
|
210946587 |
1champgwen |
E |
June 24, 2023, 4:50 p.m. |
OK |
GNU C++20 (64) |
TESTS |
22 |
218 |
18432000 |
|
|
210962631 |
DarLam |
E |
June 24, 2023, 7:20 p.m. |
OK |
Java 11 |
TESTS |
22 |
732 |
35635200 |
|
|
210934330 |
Dukkha |
E |
June 24, 2023, 4:05 p.m. |
OK |
Java 17 |
TESTS |
22 |
701 |
11673600 |
|
|
210949111 |
SecondThread |
E |
June 24, 2023, 5 p.m. |
OK |
Java 8 |
TESTS |
22 |
1045 |
125440000 |
|
|
210947453 |
misorin |
E |
June 24, 2023, 4:53 p.m. |
OK |
PyPy 3-64 |
TESTS |
22 |
748 |
32051200 |
|
|
210939937 |
cpchenpi |
E |
June 24, 2023, 4:24 p.m. |
OK |
Rust 2021 |
TESTS |
22 |
233 |
36454400 |
|
|
210941897 |
Spheniscine |
E |
June 24, 2023, 4:31 p.m. |
OK |
Rust 2021 |
TESTS |
22 |
295 |
38604800 |
|
|
remove filters
Back to search problems