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'You are given a set of points x_1 , x_2 , ..., x_n on the number line. Two points i and j can be matched with each other if the following conditions hold: What is the maximum number of pairs of points you can match with each other? The first line contains two integers n and z ( 2 <= n <= 2 cdot 10^5 , 1 <= z <= 10^9 ) -- the number of points and the constraint on the distance between matched points, respectively. The second line contains n integers x_1 , x_2 , ..., x_n ( 1 <= x_i <= 10^9 ). Print one integer -- the maximum number of pairs of points you can match with each other. In the first example, you may match point 1 with point 2 ( |3 - 1| ge 2 ), and point 3 with point 4 ( |7 - 3| ge 2 ). In the second example, you may match point 1 with point 3 ( |5 - 10| ge 5 ). '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
53676877 |
zhongzh13 |
C |
May 2, 2019, 4:26 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
45 |
1154 |
819200 |
|
2000 |
53676919 |
zhongzh13 |
C |
May 2, 2019, 4:27 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
45 |
1185 |
1024000 |
|
2000 |
53653675 |
hack1nt0 |
C |
May 2, 2019, 3:12 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
45 |
1294 |
1024000 |
|
2000 |
53634087 |
ruban |
C |
May 1, 2019, 3:51 p.m. |
OK |
Delphi |
TESTS |
45 |
171 |
145305600 |
|
2000 |
53666446 |
Denor |
C |
May 2, 2019, 10:43 a.m. |
OK |
Delphi |
TESTS |
45 |
733 |
819200 |
|
2000 |
53626393 |
PAG |
C |
May 1, 2019, 3:19 p.m. |
OK |
Delphi |
TESTS |
45 |
763 |
819200 |
|
2000 |
53626270 |
Ruadh |
C |
May 1, 2019, 3:19 p.m. |
OK |
GNU C11 |
TESTS |
45 |
77 |
1638400 |
|
2000 |
55128957 |
sansen |
C |
June 5, 2019, 2:15 p.m. |
OK |
GNU C11 |
TESTS |
45 |
77 |
1638400 |
|
2000 |
53628463 |
jschr |
C |
May 1, 2019, 3:26 p.m. |
OK |
GNU C11 |
TESTS |
45 |
78 |
819200 |
|
2000 |
53675138 |
Noetu |
C |
May 2, 2019, 3:21 p.m. |
OK |
GNU C11 |
TESTS |
45 |
78 |
819200 |
|
2000 |
53681194 |
Sarica |
C |
May 2, 2019, 7:22 p.m. |
OK |
GNU C11 |
TESTS |
45 |
78 |
819200 |
|
2000 |
53650146 |
rainboy |
C |
May 1, 2019, 11:43 p.m. |
OK |
GNU C11 |
TESTS |
45 |
78 |
819200 |
|
2000 |
53650958 |
kaiboy |
C |
May 2, 2019, 1 a.m. |
OK |
GNU C11 |
TESTS |
45 |
78 |
819200 |
|
2000 |
58129145 |
Alfeh |
C |
Aug. 1, 2019, 1:37 p.m. |
OK |
GNU C11 |
TESTS |
45 |
93 |
1638400 |
|
2000 |
53657830 |
HSZ |
C |
May 2, 2019, 5:59 a.m. |
OK |
GNU C11 |
TESTS |
45 |
93 |
1638400 |
|
2000 |
53856660 |
about |
C |
May 7, 2019, 4:36 p.m. |
OK |
GNU C11 |
TESTS |
45 |
93 |
21094400 |
|
2000 |
55865609 |
tabbbbbb |
C |
June 21, 2019, 11:59 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
31 |
819200 |
|
2000 |
60248456 |
Karry5307 |
C |
Sept. 8, 2019, 4:58 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
31 |
1228800 |
|
2000 |
60248496 |
vjudge3 |
C |
Sept. 8, 2019, 5 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
31 |
1228800 |
|
2000 |
60351152 |
zsq259 |
C |
Sept. 10, 2019, 2:21 p.m. |
OK |
GNU C++11 |
TESTS |
45 |
31 |
1638400 |
|
2000 |
53671950 |
Holland_Pig |
C |
May 2, 2019, 1:39 p.m. |
OK |
GNU C++11 |
TESTS |
45 |
31 |
5017600 |
|
2000 |
53698590 |
luogu_bot5 |
C |
May 3, 2019, 9:02 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
46 |
614400 |
|
2000 |
53864531 |
Karnage |
C |
May 8, 2019, 1:59 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
46 |
614400 |
|
2000 |
53865805 |
Frame233 |
C |
May 8, 2019, 3:38 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
46 |
614400 |
|
2000 |
54834603 |
doubeecat |
C |
May 30, 2019, 10:23 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
46 |
614400 |
|
2000 |
53642200 |
CTP_314 |
C |
May 1, 2019, 5:05 p.m. |
OK |
GNU C++11 |
TESTS |
45 |
46 |
614400 |
|
2000 |
54092259 |
Chgtaxihe |
C |
May 14, 2019, 11:25 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
46 |
921600 |
|
2000 |
53625137 |
tokitsukaze |
C |
May 1, 2019, 3:16 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
46 |
921600 |
|
2000 |
53714393 |
enaim |
C |
May 3, 2019, 6 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
63252374 |
Mynesis |
C |
Oct. 23, 2019, 4:28 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
62879413 |
tingyu |
C |
Oct. 18, 2019, 4:21 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
60064266 |
ndhuy |
C |
Sept. 5, 2019, 8:26 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
57592360 |
TianshengLi |
C |
July 23, 2019, 12:42 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
57267471 |
vjudge3 |
C |
July 18, 2019, 7:41 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
53907709 |
soul_departed |
C |
May 9, 2019, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
53631961 |
_greedy |
C |
May 1, 2019, 3:40 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
62 |
819200 |
|
2000 |
53667439 |
interestingLSY |
C |
May 2, 2019, 11:20 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
31 |
2048000 |
|
2000 |
53689014 |
nickluo |
C |
May 3, 2019, 3:19 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
46 |
1331200 |
|
2000 |
54008352 |
lesskreker |
C |
May 11, 2019, 10:14 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
46 |
1638400 |
|
2000 |
53631334 |
HatsuneMikuo |
C |
May 1, 2019, 3:37 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
46 |
2048000 |
|
2000 |
53635537 |
panoIe |
C |
May 1, 2019, 4 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
61 |
11776000 |
|
2000 |
64055949 |
thtsshz_bgwrswh |
C |
Nov. 2, 2019, 1:23 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
62 |
819200 |
|
2000 |
53641372 |
H4XeO6 |
C |
May 1, 2019, 4:51 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
62 |
1228800 |
|
2000 |
53653540 |
doublefire |
C |
May 2, 2019, 3:07 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
62 |
1536000 |
|
2000 |
53648806 |
andywu |
C |
May 1, 2019, 9:43 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
62 |
1638400 |
|
2000 |
53623802 |
qrfkickit |
C |
May 1, 2019, 3:12 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
62 |
3174400 |
|
2000 |
54876319 |
Lancern |
C |
May 31, 2019, 11:59 a.m. |
OK |
Go |
TESTS |
45 |
93 |
5222400 |
|
2000 |
53982349 |
ak_j17_258749 |
C |
May 11, 2019, 7:48 a.m. |
OK |
Go |
TESTS |
45 |
124 |
5222400 |
|
2000 |
53943107 |
emma |
C |
May 10, 2019, 4:43 a.m. |
OK |
Go |
TESTS |
45 |
233 |
819200 |
|
2000 |
55392468 |
sad_club_piece |
C |
June 10, 2019, 10:22 a.m. |
OK |
Go |
TESTS |
45 |
233 |
5222400 |
|
2000 |
65460796 |
bluesky111 |
C |
Nov. 21, 2019, 1:53 a.m. |
OK |
Java 11 |
TESTS |
45 |
248 |
0 |
|
2000 |
63949940 |
KulikAlex |
C |
Oct. 31, 2019, 8:40 p.m. |
OK |
Java 11 |
TESTS |
45 |
265 |
0 |
|
2000 |
53733881 |
saurabh0611 |
C |
May 4, 2019, 8:29 a.m. |
OK |
Java 8 |
TESTS |
45 |
124 |
0 |
|
2000 |
53681241 |
prituladima |
C |
May 2, 2019, 7:24 p.m. |
OK |
Java 8 |
TESTS |
45 |
124 |
0 |
|
2000 |
53628123 |
uwi |
C |
May 1, 2019, 3:24 p.m. |
OK |
Java 8 |
TESTS |
45 |
124 |
0 |
|
2000 |
53769942 |
r_sutaria |
C |
May 5, 2019, 4:10 a.m. |
OK |
Java 8 |
TESTS |
45 |
140 |
0 |
|
2000 |
53648083 |
umang696 |
C |
May 1, 2019, 8:47 p.m. |
OK |
Java 8 |
TESTS |
45 |
140 |
0 |
|
2000 |
56187480 |
dj2911 |
C |
June 28, 2019, 5:48 a.m. |
OK |
Java 8 |
TESTS |
45 |
155 |
0 |
|
2000 |
53712090 |
Anonymous |
C |
May 3, 2019, 4:11 p.m. |
OK |
Java 8 |
TESTS |
45 |
155 |
0 |
|
2000 |
53681270 |
prituladima |
C |
May 2, 2019, 7:25 p.m. |
OK |
Java 8 |
TESTS |
45 |
155 |
0 |
|
2000 |
53678465 |
StayAwayFromBitches |
C |
May 2, 2019, 5:27 p.m. |
OK |
Java 8 |
TESTS |
45 |
155 |
0 |
|
2000 |
53651931 |
dalt |
C |
May 2, 2019, 1:55 a.m. |
OK |
Java 8 |
TESTS |
45 |
155 |
0 |
|
2000 |
54788751 |
Killer45 |
C |
May 29, 2019, 5:56 a.m. |
OK |
Kotlin |
TESTS |
45 |
249 |
6451200 |
|
2000 |
54157555 |
rahuldps |
C |
May 15, 2019, 4:59 a.m. |
OK |
Kotlin |
TESTS |
45 |
389 |
0 |
|
2000 |
58890515 |
Spheniscine |
C |
Aug. 16, 2019, 5:21 a.m. |
OK |
Kotlin |
TESTS |
45 |
451 |
18227200 |
|
2000 |
53648666 |
omikad |
C |
May 1, 2019, 9:30 p.m. |
OK |
Mono C# |
TESTS |
45 |
139 |
19763200 |
|
2000 |
53812530 |
SaurumanS LapsleyJuno |
C |
May 6, 2019, 7:57 a.m. |
OK |
Mono C# |
TESTS |
45 |
140 |
20582400 |
|
2000 |
53935907 |
IleksaNott |
C |
May 9, 2019, 9:42 p.m. |
OK |
Mono C# |
TESTS |
45 |
155 |
20582400 |
|
2000 |
53638764 |
sergmel |
C |
May 1, 2019, 4:23 p.m. |
OK |
Mono C# |
TESTS |
45 |
156 |
20582400 |
|
2000 |
54636627 |
TrabajoNocturno |
C |
May 25, 2019, 5:22 p.m. |
OK |
Mono C# |
TESTS |
45 |
171 |
92774400 |
|
2000 |
59549919 |
vjudge4 |
C |
Aug. 27, 2019, 2:02 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
58888379 |
vjudge3 |
C |
Aug. 16, 2019, 3:44 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
58196164 |
vjudge3 |
C |
Aug. 3, 2019, 12:31 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
58149147 |
vjudge1 |
C |
Aug. 2, 2019, 1:16 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
57968285 |
TianPingXing |
C |
July 30, 2019, 4:11 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
63625599 |
vjudge3 |
C |
Oct. 28, 2019, 3:26 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
63501191 |
vjudge3 |
C |
Oct. 26, 2019, 5:15 p.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
61763373 |
vjudge5 |
C |
Oct. 3, 2019, 7:50 a.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
65163333 |
vjudge3 |
C |
Nov. 16, 2019, 12:18 p.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
63662320 |
vjudge2 |
C |
Oct. 28, 2019, 2:14 p.m. |
OK |
MS C++ |
TESTS |
45 |
62 |
819200 |
|
2000 |
53840742 |
hwangganzi |
C |
May 7, 2019, 7:20 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
78 |
819200 |
|
2000 |
53689600 |
aigudada |
C |
May 3, 2019, 3:43 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
78 |
1024000 |
|
2000 |
53662480 |
zzq233 |
C |
May 2, 2019, 8:32 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
53642361 |
petko_mitkov |
C |
May 1, 2019, 5:08 p.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
53638940 |
petko_mitkov |
C |
May 1, 2019, 4:25 p.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
54172436 |
Tattle_ta |
C |
May 15, 2019, 11:58 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
53713961 |
CtrlAlt |
C |
May 3, 2019, 5:35 p.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
57934534 |
pmitkov |
C |
July 29, 2019, 10:02 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
57351771 |
printfok |
C |
July 20, 2019, 4:06 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
54705042 |
2018030401051 |
C |
May 27, 2019, 4:22 a.m. |
OK |
MS C++ 2017 |
TESTS |
45 |
93 |
819200 |
|
2000 |
65940736 |
Svlad_Cjelli |
C |
Nov. 29, 2019, 6:02 a.m. |
OK |
Ocaml |
TESTS |
45 |
124 |
4403200 |
|
2000 |
65939636 |
Svlad_Cjelli |
C |
Nov. 29, 2019, 5:20 a.m. |
OK |
Ocaml |
TESTS |
45 |
140 |
16384000 |
|
2000 |
53660179 |
allonsy_kim |
C |
May 2, 2019, 7:17 a.m. |
OK |
PyPy 2 |
TESTS |
45 |
186 |
13414400 |
|
2000 |
53633204 |
exoji2e |
C |
May 1, 2019, 3:46 p.m. |
OK |
PyPy 2 |
TESTS |
45 |
187 |
13004800 |
|
2000 |
53642693 |
pajenegod |
C |
May 1, 2019, 5:15 p.m. |
OK |
PyPy 2 |
TESTS |
45 |
202 |
13107200 |
|
2000 |
53628781 |
cherry_su |
C |
May 1, 2019, 3:27 p.m. |
OK |
PyPy 2 |
TESTS |
45 |
218 |
13004800 |
|
2000 |
53636797 |
gatsko |
C |
May 1, 2019, 4:09 p.m. |
OK |
PyPy 2 |
TESTS |
45 |
311 |
18944000 |
|
2000 |
53624094 |
ManasG |
C |
May 1, 2019, 3:13 p.m. |
OK |
PyPy 2 |
TESTS |
45 |
342 |
17817600 |
|
2000 |
53660836 |
ayshiff |
C |
May 2, 2019, 7:36 a.m. |
OK |
PyPy 3 |
TESTS |
45 |
296 |
17408000 |
|
2000 |
53652769 |
LevinLMKwong |
C |
May 2, 2019, 2:35 a.m. |
OK |
PyPy 3 |
TESTS |
45 |
296 |
17817600 |
|
2000 |
53643552 |
rameshaditya |
C |
May 1, 2019, 5:38 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
311 |
17612800 |
|
2000 |
53673510 |
EngineerLX |
C |
May 2, 2019, 2:27 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
311 |
18534400 |
|
2000 |
54386793 |
Paixao |
C |
May 19, 2019, 1:49 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
311 |
19251200 |
|
2000 |
53741531 |
Regius |
C |
May 4, 2019, 2:08 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
312 |
17305600 |
|
2000 |
53637016 |
binhtranit |
C |
May 1, 2019, 4:10 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
312 |
18432000 |
|
2000 |
53641728 |
Lisanaaa |
C |
May 1, 2019, 4:56 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
312 |
18636800 |
|
2000 |
53635517 |
FadeoN |
C |
May 1, 2019, 4 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
327 |
17612800 |
|
2000 |
53633590 |
lollihunter |
C |
May 1, 2019, 3:48 p.m. |
OK |
PyPy 3 |
TESTS |
45 |
327 |
17715200 |
|
2000 |
53712274 |
Helli.code |
C |
May 3, 2019, 4:16 p.m. |
OK |
Python 2 |
TESTS |
45 |
374 |
11161600 |
|
2000 |
58914687 |
soumyasarkar1998 |
C |
Aug. 16, 2019, 2:28 p.m. |
OK |
Python 2 |
TESTS |
45 |
421 |
11161600 |
|
2000 |
53622562 |
nwi |
C |
May 1, 2019, 3:08 p.m. |
OK |
Python 2 |
TESTS |
45 |
546 |
11264000 |
|
2000 |
53627020 |
wunder9l |
C |
May 1, 2019, 3:21 p.m. |
OK |
Python 2 |
TESTS |
45 |
732 |
24985600 |
|
2000 |
53663541 |
maddenvvs |
C |
May 2, 2019, 9:07 a.m. |
OK |
Python 3 |
TESTS |
45 |
280 |
15974400 |
|
2000 |
59924820 |
user_0001 |
C |
Sept. 3, 2019, 3:01 a.m. |
OK |
Python 3 |
TESTS |
45 |
280 |
16076800 |
|
2000 |
68051233 |
Gaurav1 |
C |
Jan. 1, 2020, 6:58 p.m. |
OK |
Python 3 |
TESTS |
45 |
280 |
16384000 |
|
2000 |
53711884 |
motatoes |
C |
May 3, 2019, 4:05 p.m. |
OK |
Python 3 |
TESTS |
45 |
280 |
16486400 |
|
2000 |
53633067 |
tieros |
C |
May 1, 2019, 3:45 p.m. |
OK |
Python 3 |
TESTS |
45 |
295 |
16076800 |
|
2000 |
53665096 |
KanhuKeNanu |
C |
May 2, 2019, 9:54 a.m. |
OK |
Python 3 |
TESTS |
45 |
296 |
16076800 |
|
2000 |
53673721 |
ulyss |
C |
May 2, 2019, 2:34 p.m. |
OK |
Python 3 |
TESTS |
45 |
296 |
16486400 |
|
2000 |
53789254 |
vjudge4 |
C |
May 5, 2019, 11:55 a.m. |
OK |
Python 3 |
TESTS |
45 |
311 |
16179200 |
|
2000 |
53694465 |
jayantasadhu4557 |
C |
May 3, 2019, 6:56 a.m. |
OK |
Python 3 |
TESTS |
45 |
311 |
16179200 |
|
2000 |
53712189 |
Chizhonkova |
C |
May 3, 2019, 4:13 p.m. |
OK |
Python 3 |
TESTS |
45 |
311 |
16179200 |
|
2000 |
54298768 |
Kaidora |
C |
May 17, 2019, 4 p.m. |
OK |
Ruby |
TESTS |
45 |
296 |
32768000 |
|
2000 |
53684895 |
rinzu |
C |
May 2, 2019, 11:13 p.m. |
OK |
Ruby |
TESTS |
45 |
592 |
34201600 |
|
2000 |
53685138 |
rinzu |
C |
May 2, 2019, 11:38 p.m. |
OK |
Ruby |
TESTS |
45 |
623 |
34201600 |
|
2000 |
53891484 |
EbTech |
C |
May 9, 2019, 12:45 a.m. |
OK |
Rust |
TESTS |
45 |
78 |
10956800 |
|
2000 |
55416861 |
kobae964 |
C |
June 11, 2019, 3:15 a.m. |
OK |
Rust |
TESTS |
45 |
155 |
1945600 |
|
2000 |
56785560 |
yakamoto |
C |
July 10, 2019, 8:14 a.m. |
OK |
Scala |
TESTS |
45 |
498 |
0 |
|
2000 |
remove filters
Back to search problems