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"During the programming classes Vasya was assigned a difficult problem. However, he doesn't know how to code and was unable to find the solution in the Internet, so he asks you to help. You are given a sequence a , consisting of n distinct integers, that is used to construct the binary search tree. Below is the formal description of the construction process. The first line of the input contains a single integer n ( 2 <= q n <= q 100 ,000 ) -- the length of the sequence a . The second line contains n distinct integers a_i ( 1 <= q a_i <= q 10^9 ) -- the sequence a itself. Output n - 1 integers. For all i > 1 print the value written in the node that is the parent of the node with value a_i in it. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
51536033 |
rr_ |
D |
March 19, 2019, 5:03 p.m. |
OK |
D |
TESTS |
40 |
140 |
11878400 |
|
1800 |
18167415 |
lkmcfj |
D |
May 31, 2016, 11:11 a.m. |
OK |
FPC |
TESTS |
40 |
234 |
4198400 |
|
1800 |
18025795 |
dmlocdmloc |
D |
May 22, 2016, 4:15 a.m. |
OK |
FPC |
TESTS |
40 |
265 |
8601600 |
|
1800 |
18228951 |
k2nt |
D |
June 3, 2016, 9:23 a.m. |
OK |
FPC |
TESTS |
40 |
296 |
7680000 |
|
1800 |
21176852 |
unnamed_04 |
D |
Oct. 4, 2016, 2:29 a.m. |
OK |
FPC |
TESTS |
40 |
311 |
6860800 |
|
1800 |
21176771 |
unnamed_04 |
D |
Oct. 4, 2016, 2:23 a.m. |
OK |
FPC |
TESTS |
40 |
311 |
6860800 |
|
1800 |
18003431 |
rmtgh |
D |
May 20, 2016, 11 a.m. |
OK |
GNU C |
TESTS |
40 |
93 |
7680000 |
|
1800 |
18026472 |
rmtgh |
D |
May 22, 2016, 5:48 a.m. |
OK |
GNU C |
TESTS |
40 |
109 |
6860800 |
|
1800 |
18651374 |
Chipe1 |
D |
June 22, 2016, 6:36 p.m. |
OK |
GNU C |
TESTS |
40 |
124 |
6553600 |
|
1800 |
18003468 |
rmtgh |
D |
May 20, 2016, 11:03 a.m. |
OK |
GNU C |
TESTS |
40 |
124 |
6758400 |
|
1800 |
17980347 |
Chipe1 |
D |
May 18, 2016, 1:23 p.m. |
OK |
GNU C |
TESTS |
40 |
139 |
8601600 |
|
1800 |
17980355 |
Chipe1 |
D |
May 18, 2016, 1:23 p.m. |
OK |
GNU C |
TESTS |
40 |
171 |
8601600 |
|
1800 |
18213486 |
Phoenix_Galaxy |
D |
June 2, 2016, 9:05 a.m. |
OK |
GNU C |
TESTS |
40 |
217 |
37888000 |
|
1800 |
18143226 |
vjudge2 |
D |
May 29, 2016, 8:33 a.m. |
OK |
GNU C |
TESTS |
40 |
1996 |
4096000 |
|
1800 |
18582706 |
Arch0n |
D |
June 18, 2016, 3:43 p.m. |
OK |
GNU C++ |
TESTS |
40 |
46 |
4096000 |
|
1800 |
19076246 |
AkaneSasu |
D |
July 13, 2016, 3:19 p.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
3174400 |
|
1800 |
18837003 |
TerryHu |
D |
July 1, 2016, 8:28 a.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
3481600 |
|
1800 |
23526341 |
vjudge4 |
D |
Jan. 4, 2017, 1:16 a.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
3891200 |
|
1800 |
23678378 |
vjudge1 |
D |
Jan. 10, 2017, 9:44 a.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
4505600 |
|
1800 |
18113106 |
chentong |
D |
May 27, 2016, 5:36 a.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
4505600 |
|
1800 |
24481851 |
LCF |
D |
Feb. 7, 2017, 5:59 a.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
10137600 |
|
1800 |
20385316 |
adkroxx |
D |
Sept. 4, 2016, 3:37 p.m. |
OK |
GNU C++ |
TESTS |
40 |
62 |
13209600 |
|
1800 |
20771094 |
Talon_F |
D |
Sept. 20, 2016, 8:41 a.m. |
OK |
GNU C++ |
TESTS |
40 |
77 |
1843200 |
|
1800 |
18784989 |
mohitf |
D |
June 29, 2016, 2:56 p.m. |
OK |
GNU C++ |
TESTS |
40 |
77 |
3276800 |
|
1800 |
56848588 |
rainboy |
D |
July 11, 2019, 2:40 p.m. |
OK |
GNU C11 |
TESTS |
30 |
451 |
2048000 |
|
1800 |
32961169 |
stevenzheng2002 |
D |
Dec. 6, 2017, 3:41 a.m. |
OK |
GNU C++11 |
TESTS |
40 |
46 |
4505600 |
|
1800 |
20046391 |
coderghj |
D |
Aug. 22, 2016, 12:58 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
46 |
6553600 |
|
1800 |
53173314 |
gn_wz |
D |
April 23, 2019, 12:53 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
46 |
7270400 |
|
1800 |
40984440 |
ReaLNero1 |
D |
July 30, 2018, 7:23 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
62 |
4505600 |
|
1800 |
18063232 |
singh1495 |
D |
May 24, 2016, 7:13 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
62 |
4608000 |
|
1800 |
18020341 |
ACMonster |
D |
May 21, 2016, 2:55 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
62 |
5427200 |
|
1800 |
18158161 |
WFang |
D |
May 30, 2016, 2:24 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
62 |
14848000 |
|
1800 |
59696131 |
luogu_bot4 |
D |
Aug. 30, 2019, 8:40 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
77 |
2457600 |
|
1800 |
20488509 |
Not_A_SingleDogQrz |
D |
Sept. 10, 2016, 1:48 a.m. |
OK |
GNU C++11 |
TESTS |
40 |
77 |
2764800 |
|
1800 |
17994679 |
w007878 |
D |
May 19, 2016, 4:49 p.m. |
OK |
GNU C++11 |
TESTS |
40 |
77 |
4198400 |
|
1800 |
30228774 |
vjudge1 |
D |
Sept. 9, 2017, 3:16 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
3379200 |
|
1800 |
32010418 |
trump5377 hasan_356 |
D |
Nov. 3, 2017, 2:32 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
4198400 |
|
1800 |
49904168 |
tiliguzov |
D |
Feb. 14, 2019, 11:06 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
4608000 |
|
1800 |
32882117 |
ArshiaDadras |
D |
Dec. 2, 2017, 6:27 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
5222400 |
|
1800 |
28353220 |
after |
D |
July 7, 2017, 4:29 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
5324800 |
|
1800 |
34279572 |
AbolfazlB3 |
D |
Jan. 18, 2018, 3:17 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
5427200 |
|
1800 |
23353729 |
_index |
D |
Dec. 27, 2016, 6:51 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
8192000 |
|
1800 |
26660583 |
gaporf |
D |
April 25, 2017, 12:45 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
78 |
9728000 |
|
1800 |
30228717 |
vjudge1 |
D |
Sept. 9, 2017, 3:13 p.m. |
OK |
GNU C++14 |
TESTS |
40 |
93 |
3379200 |
|
1800 |
69637164 |
HipHop |
D |
Jan. 27, 2020, 7:08 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
93 |
3379200 |
|
1800 |
41221052 |
bringMeBack_ |
D |
Aug. 4, 2018, 3:46 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
3379200 |
|
1800 |
42137614 |
XieXianWang |
D |
Aug. 27, 2018, 1:46 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
3379200 |
|
1800 |
44436898 |
ivan100sic |
D |
Oct. 17, 2018, 10:30 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
3686400 |
|
1800 |
60952618 |
yuhta |
D |
Sept. 20, 2019, 11:15 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
93 |
3788800 |
|
1800 |
45998003 |
KhaledKEE |
D |
Nov. 20, 2018, 1:14 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
3993600 |
|
1800 |
54854290 |
cxsy |
D |
May 30, 2019, 6:24 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
93 |
4198400 |
|
1800 |
49105291 |
coloredrabbit |
D |
Jan. 28, 2019, 12:53 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
4403200 |
|
1800 |
49105394 |
coloredrabbit |
D |
Jan. 28, 2019, 12:55 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
4403200 |
|
1800 |
47852672 |
mTvTm |
D |
Jan. 2, 2019, 6:53 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
6246400 |
|
1800 |
36775336 |
kzvd4729 |
D |
March 31, 2018, 1:34 p.m. |
OK |
GNU C++17 |
TESTS |
40 |
93 |
6758400 |
|
1800 |
18009714 |
deepraiya17 |
D |
May 20, 2016, 6:56 p.m. |
OK |
Java 7 |
TESTS |
40 |
218 |
39321600 |
|
1800 |
18119108 |
sanket407 |
D |
May 27, 2016, 1:40 p.m. |
OK |
Java 7 |
TESTS |
40 |
233 |
46796800 |
|
1800 |
18859375 |
228 |
D |
July 2, 2016, 8:42 p.m. |
OK |
Java 7 |
TESTS |
40 |
265 |
0 |
|
1800 |
18586499 |
MazzForces |
D |
June 18, 2016, 8:16 p.m. |
OK |
Java 7 |
TESTS |
40 |
265 |
307200 |
|
1800 |
18771709 |
mkirsche |
D |
June 28, 2016, 6:06 p.m. |
OK |
Java 7 |
TESTS |
40 |
296 |
6348800 |
|
1800 |
18248878 |
ya_rb |
D |
June 4, 2016, 8:49 p.m. |
OK |
Java 7 |
TESTS |
40 |
327 |
47923200 |
|
1800 |
17983006 |
lebaur |
D |
May 18, 2016, 4:52 p.m. |
OK |
Java 7 |
TESTS |
40 |
373 |
46899200 |
|
1800 |
18590323 |
HarrisonFang |
D |
June 19, 2016, 3:44 a.m. |
OK |
Java 7 |
TESTS |
40 |
514 |
5734400 |
|
1800 |
17993050 |
amber_tt |
D |
May 19, 2016, 2:56 p.m. |
OK |
Java 7 |
TESTS |
40 |
576 |
45363200 |
|
1800 |
18055971 |
yan_lazy |
D |
May 24, 2016, 1:23 p.m. |
OK |
Java 7 |
TESTS |
40 |
654 |
40345600 |
|
1800 |
55477461 |
programbhavan |
D |
June 12, 2019, 1:46 a.m. |
OK |
Java 8 |
TESTS |
30 |
233 |
0 |
|
1800 |
45285592 |
qpalzmwoskxn |
D |
Nov. 4, 2018, 4:25 p.m. |
OK |
Java 8 |
TESTS |
40 |
233 |
4198400 |
|
1800 |
22385609 |
Bruteforceman |
D |
Nov. 21, 2016, 2:42 p.m. |
OK |
Java 8 |
TESTS |
40 |
233 |
6758400 |
|
1800 |
19199967 |
hama-du |
D |
July 18, 2016, 3:39 a.m. |
OK |
Java 8 |
TESTS |
40 |
249 |
5222400 |
|
1800 |
17983026 |
Carson |
D |
May 18, 2016, 4:54 p.m. |
OK |
Java 8 |
TESTS |
40 |
249 |
21913600 |
|
1800 |
17981775 |
c4cheats |
D |
May 18, 2016, 3:10 p.m. |
OK |
Java 8 |
TESTS |
40 |
249 |
26112000 |
|
1800 |
26801965 |
vjudge3 |
D |
May 2, 2017, 12:24 p.m. |
OK |
Java 8 |
TESTS |
40 |
249 |
26521600 |
|
1800 |
17980206 |
ankurverma1994 |
D |
May 18, 2016, 1:16 p.m. |
OK |
Java 8 |
TESTS |
40 |
264 |
27136000 |
|
1800 |
18139214 |
exoji2e |
D |
May 28, 2016, 10:26 p.m. |
OK |
Java 8 |
TESTS |
40 |
265 |
26624000 |
|
1800 |
33608181 |
flyman3046 |
D |
Dec. 25, 2017, 4:20 a.m. |
OK |
Java 8 |
TESTS |
40 |
265 |
28672000 |
|
1800 |
18129958 |
JS_Lighter |
D |
May 28, 2016, 10:09 a.m. |
OK |
JavaScript |
TESTS |
40 |
358 |
43417600 |
|
1800 |
18145617 |
zerg |
D |
May 29, 2016, 11:19 a.m. |
OK |
MS C# |
TESTS |
40 |
155 |
23142400 |
|
1800 |
18285386 |
AnatolyTolstobrov |
D |
June 7, 2016, 2:03 p.m. |
OK |
MS C# |
TESTS |
40 |
186 |
27955200 |
|
1800 |
18009452 |
og.kostya |
D |
May 20, 2016, 6:27 p.m. |
OK |
MS C# |
TESTS |
40 |
187 |
15462400 |
|
1800 |
18295534 |
DigitalArtistKz |
D |
June 8, 2016, 9:05 a.m. |
OK |
MS C# |
TESTS |
40 |
187 |
36249600 |
|
1800 |
18171804 |
kuzAnatoliy |
D |
May 31, 2016, 4:43 p.m. |
OK |
MS C# |
TESTS |
40 |
655 |
29388800 |
|
1800 |
18151276 |
alkhizha |
D |
May 29, 2016, 9:03 p.m. |
OK |
MS C++ |
TESTS |
40 |
93 |
5427200 |
|
1800 |
25563300 |
0bps |
D |
March 17, 2017, 3:26 a.m. |
OK |
MS C++ |
TESTS |
40 |
93 |
9318400 |
|
1800 |
18114204 |
vjudge2 |
D |
May 27, 2016, 7:15 a.m. |
OK |
MS C++ |
TESTS |
40 |
93 |
18636800 |
|
1800 |
20456580 |
Klight1994 |
D |
Sept. 8, 2016, 11:09 a.m. |
OK |
MS C++ |
TESTS |
40 |
108 |
3276800 |
|
1800 |
23540538 |
hAkunA_mAtAtA_98 |
D |
Jan. 4, 2017, 5:23 p.m. |
OK |
MS C++ |
TESTS |
40 |
109 |
5324800 |
|
1800 |
23540145 |
hAkunA_mAtAtA_98 |
D |
Jan. 4, 2017, 5:03 p.m. |
OK |
MS C++ |
TESTS |
40 |
109 |
5324800 |
|
1800 |
25457871 |
noru0114 |
D |
March 13, 2017, 4:12 p.m. |
OK |
MS C++ |
TESTS |
40 |
109 |
8499200 |
|
1800 |
25457501 |
noru0114 |
D |
March 13, 2017, 3:52 p.m. |
OK |
MS C++ |
TESTS |
40 |
109 |
8499200 |
|
1800 |
18513429 |
nicky_ua |
D |
June 16, 2016, 6:22 a.m. |
OK |
MS C++ |
TESTS |
40 |
109 |
17715200 |
|
1800 |
19397977 |
vjudge3 |
D |
July 25, 2016, 7:39 a.m. |
OK |
MS C++ |
TESTS |
40 |
124 |
6451200 |
|
1800 |
18027389 |
old_boo |
D |
May 22, 2016, 7:22 a.m. |
OK |
Ocaml |
TESTS |
40 |
202 |
11264000 |
|
1800 |
18027361 |
old_boo |
D |
May 22, 2016, 7:19 a.m. |
OK |
Ocaml |
TESTS |
40 |
202 |
11468800 |
|
1800 |
18026440 |
old_boo |
D |
May 22, 2016, 5:44 a.m. |
OK |
Ocaml |
TESTS |
40 |
342 |
15052800 |
|
1800 |
18170520 |
Eeyore |
D |
May 31, 2016, 3:06 p.m. |
OK |
PyPy 2 |
TESTS |
40 |
545 |
49459200 |
|
1800 |
18272939 |
johannesk |
D |
June 6, 2016, 4:23 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
1481 |
40140800 |
|
1800 |
17998065 |
orailly |
D |
May 19, 2016, 11:18 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
1871 |
49254400 |
|
1800 |
18118872 |
house1993 |
D |
May 27, 2016, 1:25 p.m. |
OK |
Python 3 |
TESTS |
40 |
1294 |
21504000 |
|
1800 |
17983058 |
Andfive |
D |
May 18, 2016, 4:58 p.m. |
OK |
Python 3 |
TESTS |
40 |
1294 |
21504000 |
|
1800 |
18261303 |
zhangyu19900418 |
D |
June 5, 2016, 6:52 p.m. |
OK |
Python 3 |
TESTS |
40 |
1434 |
21504000 |
|
1800 |
18119251 |
house1993 |
D |
May 27, 2016, 1:50 p.m. |
OK |
Python 3 |
TESTS |
40 |
1606 |
23449600 |
|
1800 |
18063710 |
dr.ikros |
D |
May 24, 2016, 8:10 p.m. |
OK |
Scala |
TESTS |
40 |
982 |
49971200 |
|
1800 |
remove filters
Back to search problems