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"In the lattice points of the coordinate line there are n radio stations, the i-th of which is described by three integers: We will say that two radio stations with numbers i and j reach each other, if the broadcasting range of each of them is more or equal to the distance between them. In other words min(ri, xe2 x80 x89rj) xe2 x80 x89 xe2 x89 xa5 xe2 x80 x89|xi xe2 x80 x89- xe2 x80 x89xj|. Let's call a pair of radio stations (i, xe2 x80 x89j) bad if i xe2 x80 x89< xe2 x80 x89j, stations i and j reach each other and they are close in frequency, that is, |fi xe2 x80 x89- xe2 x80 x89fj| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k. Find the number of bad pairs of radio stations. The first line contains two integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8910) -- the number of radio stations and the maximum difference in the frequencies for the pair of stations that reach each other to be considered bad. In the next n lines follow the descriptions of radio stations. Each line contains three integers xi, ri and fi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi, xe2 x80 x89ri xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89fi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89104) -- the coordinate of the i-th radio station, it's broadcasting range and it's broadcasting frequency. No two radio stations will share a coordinate. Output the number of bad pairs of radio stations. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
40982596 |
ReaLNero1 |
E |
July 30, 2018, 6:29 p.m. |
OK |
GNU C++ |
TESTS |
69 |
171 |
7065600 |
|
2400 |
24427056 |
ztx |
E |
Feb. 4, 2017, 7:45 a.m. |
OK |
GNU C++ |
TESTS |
69 |
171 |
9113600 |
|
2400 |
41548346 |
vjudge4 |
E |
Aug. 13, 2018, 6:48 a.m. |
OK |
GNU C++ |
TESTS |
69 |
218 |
11468800 |
|
2400 |
41666024 |
vjudge1 |
E |
Aug. 16, 2018, 11:21 p.m. |
OK |
GNU C++ |
TESTS |
69 |
218 |
17715200 |
|
2400 |
35777777 |
lxy666 |
E |
Feb. 28, 2018, 7:55 a.m. |
OK |
GNU C++ |
TESTS |
69 |
218 |
19353600 |
|
2400 |
40684408 |
lcclcc |
E |
July 24, 2018, 12:36 a.m. |
OK |
GNU C++ |
TESTS |
69 |
234 |
17305600 |
|
2400 |
24132290 |
Vladik |
E |
Jan. 25, 2017, 5:13 p.m. |
OK |
GNU C++ |
TESTS |
69 |
249 |
14540800 |
|
2400 |
40688016 |
vjudge1 |
E |
July 24, 2018, 3:45 a.m. |
OK |
GNU C++ |
TESTS |
69 |
249 |
17510400 |
|
2400 |
40688008 |
Xiang |
E |
July 24, 2018, 3:44 a.m. |
OK |
GNU C++ |
TESTS |
69 |
249 |
17510400 |
|
2400 |
40668786 |
vjudge2 |
E |
July 23, 2018, 11:30 a.m. |
OK |
GNU C++ |
TESTS |
69 |
264 |
7065600 |
|
2400 |
60936767 |
rainboy |
E |
Sept. 20, 2019, 3:37 p.m. |
OK |
GNU C11 |
TESTS |
69 |
514 |
6451200 |
|
2400 |
24128405 |
sfiction |
E |
Jan. 25, 2017, 4:15 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
171 |
7475200 |
|
2400 |
24132110 |
Vladik |
E |
Jan. 25, 2017, 5:09 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
186 |
14540800 |
|
2400 |
24903256 |
krijgertje |
E |
Feb. 22, 2017, 10:50 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
202 |
6656000 |
|
2400 |
24132364 |
Vladik |
E |
Jan. 25, 2017, 5:15 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
202 |
13824000 |
|
2400 |
53111116 |
CQUzbx |
E |
April 22, 2019, 3:01 a.m. |
OK |
GNU C++11 |
TESTS |
69 |
202 |
17305600 |
|
2400 |
56674473 |
vjudge1 |
E |
July 7, 2019, 2:46 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
218 |
17305600 |
|
2400 |
56674438 |
P_Wang |
E |
July 7, 2019, 2:45 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
218 |
17305600 |
|
2400 |
56673555 |
P_Wang |
E |
July 7, 2019, 2:18 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
218 |
17305600 |
|
2400 |
56710449 |
luogu_bot3 |
E |
July 8, 2019, 12:34 p.m. |
OK |
GNU C++11 |
TESTS |
69 |
218 |
17305600 |
|
2400 |
24424687 |
newgate |
E |
Feb. 4, 2017, 4:51 a.m. |
OK |
GNU C++11 |
TESTS |
69 |
218 |
19148800 |
|
2400 |
24236772 |
YakutovDmitriy |
E |
Jan. 28, 2017, 9:24 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
202 |
12390400 |
|
2400 |
24236741 |
YakutovDmitriy |
E |
Jan. 28, 2017, 9:22 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
202 |
12595200 |
|
2400 |
24179357 |
paruki |
E |
Jan. 27, 2017, 1:54 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
233 |
7782400 |
|
2400 |
27482963 |
nuip |
E |
June 1, 2017, 11:01 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
249 |
6656000 |
|
2400 |
43559789 |
vjudge4 |
E |
Sept. 29, 2018, 8:17 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
249 |
17305600 |
|
2400 |
24432180 |
sz1231 |
E |
Feb. 4, 2017, 12:41 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
249 |
19558400 |
|
2400 |
24433401 |
sz1231 |
E |
Feb. 4, 2017, 1:52 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
249 |
19558400 |
|
2400 |
24432140 |
sz1231 |
E |
Feb. 4, 2017, 12:39 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
264 |
19251200 |
|
2400 |
40415165 |
pzdba |
E |
July 16, 2018, 2:34 p.m. |
OK |
GNU C++14 |
TESTS |
69 |
265 |
6348800 |
|
2400 |
43559721 |
vjudge1 |
E |
Sept. 29, 2018, 8:15 a.m. |
OK |
GNU C++14 |
TESTS |
69 |
265 |
17305600 |
|
2400 |
67787004 |
vjudge3 |
E |
Dec. 28, 2019, 1:09 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
233 |
48128000 |
|
2400 |
60667776 |
kal0rona |
E |
Sept. 16, 2019, 9:05 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
234 |
17305600 |
|
2400 |
52631723 |
vjudge4 |
E |
April 12, 2019, 7:30 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
234 |
17305600 |
|
2400 |
39851934 |
Juniorandrade |
E |
July 1, 2018, 9:53 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
280 |
7782400 |
|
2400 |
50635288 |
markotee |
E |
March 1, 2019, 11:29 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
296 |
6860800 |
|
2400 |
38596247 |
RUSH_D_CAT |
E |
May 24, 2018, 8:28 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
296 |
24064000 |
|
2400 |
54857306 |
err0r |
E |
May 30, 2019, 8:35 p.m. |
OK |
GNU C++17 |
TESTS |
69 |
311 |
7270400 |
|
2400 |
39014080 |
065583 |
E |
June 7, 2018, 9:13 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
311 |
40140800 |
|
2400 |
56192204 |
kongroo |
E |
June 28, 2019, 8:13 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
312 |
8294400 |
|
2400 |
42077758 |
lintoto |
E |
Aug. 25, 2018, 6:41 a.m. |
OK |
GNU C++17 |
TESTS |
69 |
374 |
38092800 |
|
2400 |
28659086 |
goC |
E |
July 18, 2017, 6:50 a.m. |
OK |
Go |
TESTS |
69 |
655 |
10547200 |
|
2400 |
25663322 |
roberto_firmino |
E |
March 20, 2017, 10:33 a.m. |
OK |
Java 8 |
TESTS |
69 |
810 |
20684800 |
|
2400 |
47173730 |
fabregastung2 |
E |
Dec. 17, 2018, 4:23 p.m. |
OK |
Java 8 |
TESTS |
69 |
1107 |
0 |
|
2400 |
24237023 |
stevie1024 |
E |
Jan. 28, 2017, 9:46 p.m. |
OK |
Java 8 |
TESTS |
69 |
1107 |
42393600 |
|
2400 |
60935969 |
Dukkha |
E |
Sept. 20, 2019, 3:20 p.m. |
OK |
Java 8 |
TESTS |
69 |
1123 |
15155200 |
|
2400 |
30859535 |
Maulik_Patel |
E |
Sept. 30, 2017, 8:40 a.m. |
OK |
Java 8 |
TESTS |
69 |
1170 |
5017600 |
|
2400 |
24464333 |
JialinOuyang |
E |
Feb. 6, 2017, 7:38 a.m. |
OK |
Java 8 |
TESTS |
69 |
1170 |
21504000 |
|
2400 |
60936873 |
Dukkha |
E |
Sept. 20, 2019, 3:39 p.m. |
OK |
Java 8 |
TESTS |
69 |
1185 |
15155200 |
|
2400 |
24464177 |
JialinOuyang |
E |
Feb. 6, 2017, 7:27 a.m. |
OK |
Java 8 |
TESTS |
69 |
1231 |
21504000 |
|
2400 |
26347788 |
roberto_firmino |
E |
April 13, 2017, 9:43 p.m. |
OK |
Java 8 |
TESTS |
69 |
1247 |
27340800 |
|
2400 |
24464624 |
JialinOuyang |
E |
Feb. 6, 2017, 8:01 a.m. |
OK |
Java 8 |
TESTS |
69 |
1263 |
21606400 |
|
2400 |
24130023 |
AnatolyTolstobrov |
E |
Jan. 25, 2017, 4:31 p.m. |
OK |
MS C# |
TESTS |
69 |
436 |
19763200 |
|
2400 |
24153632 |
og.kostya |
E |
Jan. 26, 2017, 5 p.m. |
OK |
MS C# |
TESTS |
69 |
467 |
14131200 |
|
2400 |
24150671 |
AleksanderBalobanov |
E |
Jan. 26, 2017, 2:34 p.m. |
OK |
MS C++ |
TESTS |
69 |
234 |
38707200 |
|
2400 |
24132321 |
Vladik |
E |
Jan. 25, 2017, 5:14 p.m. |
OK |
MS C++ |
TESTS |
69 |
327 |
16486400 |
|
2400 |
30856803 |
marszed |
E |
Sept. 30, 2017, 6:47 a.m. |
OK |
MS C++ |
TESTS |
69 |
795 |
32153600 |
|
2400 |
24704521 |
wp32pw |
E |
Feb. 15, 2017, 7:57 p.m. |
OK |
MS C++ |
TESTS |
69 |
1138 |
14848000 |
|
2400 |
24228088 |
TheConfessor |
E |
Jan. 28, 2017, 2:47 p.m. |
OK |
MS C++ |
TESTS |
69 |
1247 |
70348800 |
|
2400 |
54241096 |
vjudge2 |
E |
May 16, 2019, 12:59 p.m. |
OK |
MS C++ |
TESTS |
69 |
1326 |
197734400 |
|
2400 |
24228185 |
TheConfessor |
E |
Jan. 28, 2017, 2:53 p.m. |
OK |
MS C++ |
TESTS |
69 |
1357 |
70348800 |
|
2400 |
24228128 |
TheConfessor |
E |
Jan. 28, 2017, 2:49 p.m. |
OK |
MS C++ |
TESTS |
69 |
1403 |
70348800 |
|
2400 |
54241023 |
chenyewei_1234 |
E |
May 16, 2019, 12:57 p.m. |
OK |
MS C++ 2017 |
TESTS |
69 |
1435 |
197734400 |
|
2400 |
remove filters
Back to search problems