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 Y of n distinct positive integers y1, xe2 x80 x89y2, xe2 x80 x89..., xe2 x80 x89yn. Set X of n distinct positive integers x1, xe2 x80 x89x2, xe2 x80 x89..., xe2 x80 x89xn is said to generate set Y if one can transform X to Y by applying some number of the following two operation to integers in X: Note that integers in X are not required to be distinct after each operation. Two sets of distinct integers X and Y are equal if they are equal as sets. In other words, if we write elements of the sets in the array in the increasing order, these arrays would be equal. Note, that any set of integers (or its permutation) generates itself. You are given a set Y and have to find a set X that generates Y and the maximum element of X is mininum possible. The first line of the input contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8950 xe2 x80 x89000) -- the number of elements in Y. The second line contains n integers y1, xe2 x80 x89..., xe2 x80 x89yn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89yi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), that are guaranteed to be distinct. Print n integers -- set of distinct integers that generate Y and the maximum element of which is minimum possible. If there are several such sets, print any of them. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
23248274 |
FalseMirror |
D |
Dec. 23, 2016, 1:24 p.m. |
OK |
D |
TESTS |
49 |
358 |
14950400 |
|
1900 |
21090696 |
shino_ |
D |
Oct. 1, 2016, 3:54 p.m. |
OK |
FPC |
TESTS |
49 |
171 |
15769600 |
|
1900 |
21792210 |
MintGreen |
D |
Oct. 26, 2016, 11:05 a.m. |
OK |
FPC |
TESTS |
49 |
186 |
12185600 |
|
1900 |
22108248 |
dujunyi |
D |
Nov. 8, 2016, 8:29 a.m. |
OK |
FPC |
TESTS |
49 |
186 |
123904000 |
|
1900 |
21104418 |
llgyc |
D |
Oct. 2, 2016, 3 a.m. |
OK |
FPC |
TESTS |
49 |
202 |
15769600 |
|
1900 |
21107991 |
hanxueshui |
D |
Oct. 2, 2016, 7:26 a.m. |
OK |
FPC |
TESTS |
49 |
202 |
20070400 |
|
1900 |
22216322 |
WalkingDeade |
D |
Nov. 15, 2016, 3:46 a.m. |
OK |
FPC |
TESTS |
49 |
218 |
124518400 |
|
1900 |
21087902 |
0lkeh |
D |
Oct. 1, 2016, 3:30 p.m. |
OK |
FPC |
TESTS |
49 |
389 |
18124800 |
|
1900 |
21475207 |
k2nt |
D |
Oct. 16, 2016, 9:01 a.m. |
OK |
FPC |
TESTS |
49 |
701 |
23961600 |
|
1900 |
21131685 |
streek36 |
D |
Oct. 3, 2016, 8:38 a.m. |
OK |
FPC |
TESTS |
49 |
1138 |
250880000 |
|
1900 |
21085517 |
__debug |
D |
Oct. 1, 2016, 3:13 p.m. |
OK |
GNU C++ |
TESTS |
49 |
77 |
49254400 |
|
1900 |
21105388 |
chihiro |
D |
Oct. 2, 2016, 4:33 a.m. |
OK |
GNU C++ |
TESTS |
49 |
78 |
48025600 |
|
1900 |
21086843 |
Lvat2000 |
D |
Oct. 1, 2016, 3:22 p.m. |
OK |
GNU C++ |
TESTS |
49 |
93 |
1024000 |
|
1900 |
21103391 |
Liu_QY |
D |
Oct. 2, 2016, 1:22 a.m. |
OK |
GNU C++ |
TESTS |
49 |
93 |
29798400 |
|
1900 |
40983526 |
ReaLNero1 |
D |
July 30, 2018, 6:54 p.m. |
OK |
GNU C++ |
TESTS |
49 |
93 |
48025600 |
|
1900 |
21088351 |
gonglinyuan |
D |
Oct. 1, 2016, 3:34 p.m. |
OK |
GNU C++ |
TESTS |
49 |
108 |
48128000 |
|
1900 |
22104484 |
TerryHu |
D |
Nov. 8, 2016, 2:57 a.m. |
OK |
GNU C++ |
TESTS |
49 |
109 |
114790400 |
|
1900 |
21083951 |
czllgzmzl |
D |
Oct. 1, 2016, 3:02 p.m. |
OK |
GNU C++ |
TESTS |
49 |
140 |
29798400 |
|
1900 |
24447580 |
MudCoal |
D |
Feb. 5, 2017, 8:51 a.m. |
OK |
GNU C++ |
TESTS |
49 |
140 |
56012800 |
|
1900 |
21254293 |
0736TuT |
D |
Oct. 7, 2016, 9:45 a.m. |
OK |
GNU C++ |
TESTS |
49 |
140 |
97689600 |
|
1900 |
56678700 |
rainboy |
D |
July 7, 2019, 4:57 p.m. |
OK |
GNU C11 |
TESTS |
49 |
327 |
25907200 |
|
1900 |
21087506 |
houruize |
D |
Oct. 1, 2016, 3:27 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
93 |
5632000 |
|
1900 |
21098678 |
Charming_Chen |
D |
Oct. 1, 2016, 10:29 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
108 |
81408000 |
|
1900 |
21181396 |
Meowww |
D |
Oct. 4, 2016, 7:49 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
109 |
24985600 |
|
1900 |
21089331 |
Phronesis |
D |
Oct. 1, 2016, 3:42 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
109 |
85811200 |
|
1900 |
21312633 |
Jimmy22 |
D |
Oct. 9, 2016, 7:59 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
124 |
23756800 |
|
1900 |
21126499 |
Andreikkaa |
D |
Oct. 3, 2016, 12:09 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
124 |
250470400 |
|
1900 |
21084356 |
yylidiw |
D |
Oct. 1, 2016, 3:05 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
139 |
29798400 |
|
1900 |
21083320 |
KumaTomato |
D |
Oct. 1, 2016, 2:58 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
140 |
1638400 |
|
1900 |
21320036 |
Orenji.Sora |
D |
Oct. 9, 2016, 1:52 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
140 |
12083200 |
|
1900 |
21126485 |
Andreikkaa |
D |
Oct. 3, 2016, 12:06 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
140 |
250470400 |
|
1900 |
21089882 |
pew-pew |
D |
Oct. 1, 2016, 3:47 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
109 |
27648000 |
|
1900 |
21104881 |
rpk74m |
D |
Oct. 2, 2016, 3:46 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
124 |
1945600 |
|
1900 |
21104936 |
rpk74m |
D |
Oct. 2, 2016, 3:50 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
124 |
1945600 |
|
1900 |
21126492 |
Andreikkaa |
D |
Oct. 3, 2016, 12:07 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
124 |
250470400 |
|
1900 |
21090655 |
kondranin |
D |
Oct. 1, 2016, 3:54 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
155 |
1945600 |
|
1900 |
21086940 |
Aeon |
D |
Oct. 1, 2016, 3:23 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
155 |
3379200 |
|
1900 |
21111779 |
MBogda |
D |
Oct. 2, 2016, 10:29 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
156 |
1740800 |
|
1900 |
21079311 |
Melnyk |
D |
Oct. 1, 2016, 2:37 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
171 |
1740800 |
|
1900 |
21087234 |
ermolmak |
D |
Oct. 1, 2016, 3:25 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
171 |
1740800 |
|
1900 |
62626423 |
niklaci |
D |
Oct. 15, 2019, 2:11 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
171 |
1843200 |
|
1900 |
69388778 |
Cadenza |
D |
Jan. 23, 2020, 1:36 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
186 |
1843200 |
|
1900 |
44943175 |
Anti-Dark |
D |
Oct. 27, 2018, 8:50 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
187 |
1843200 |
|
1900 |
64545390 |
Anji |
D |
Nov. 8, 2019, 8:07 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
187 |
1843200 |
|
1900 |
45128676 |
DragoonKiller |
D |
Oct. 31, 2018, 9:15 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
187 |
2048000 |
|
1900 |
41997377 |
TheRN |
D |
Aug. 23, 2018, 12:55 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
202 |
1843200 |
|
1900 |
61229893 |
codingoat |
D |
Sept. 24, 2019, 4:16 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
202 |
1843200 |
|
1900 |
65440482 |
77o |
D |
Nov. 20, 2019, 2:12 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
202 |
1843200 |
|
1900 |
58173965 |
manish_joshi |
D |
Aug. 2, 2019, 12:23 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
202 |
1843200 |
|
1900 |
66157425 |
aki167yuuki |
D |
Dec. 2, 2019, 12:33 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
202 |
2048000 |
|
1900 |
49949143 |
AIBEK |
D |
Feb. 15, 2019, 1:20 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
202 |
2048000 |
|
1900 |
21134963 |
orb |
D |
Oct. 3, 2016, 11:18 a.m. |
OK |
Go |
TESTS |
49 |
717 |
19046400 |
|
1900 |
21245698 |
goC |
D |
Oct. 6, 2016, 8:51 p.m. |
OK |
Go |
TESTS |
49 |
1232 |
5222400 |
|
1900 |
21088646 |
cojna |
D |
Oct. 1, 2016, 3:36 p.m. |
OK |
Haskell |
TESTS |
49 |
343 |
12800000 |
|
1900 |
61428657 |
Petrosz |
D |
Sept. 28, 2019, 1:57 p.m. |
OK |
Haskell |
TESTS |
49 |
607 |
14848000 |
|
1900 |
21097782 |
nagibator |
D |
Oct. 1, 2016, 9:09 p.m. |
OK |
Haskell |
TESTS |
49 |
608 |
14848000 |
|
1900 |
61428073 |
Petrosz |
D |
Sept. 28, 2019, 1:46 p.m. |
OK |
Haskell |
TESTS |
49 |
624 |
14848000 |
|
1900 |
61427665 |
Petrosz |
D |
Sept. 28, 2019, 1:38 p.m. |
OK |
Haskell |
TESTS |
49 |
748 |
14848000 |
|
1900 |
63402996 |
Shady51 |
D |
Oct. 25, 2019, 7:06 p.m. |
OK |
Java 11 |
TESTS |
49 |
639 |
1331200 |
|
1900 |
21080784 |
eatmore |
D |
Oct. 1, 2016, 2:44 p.m. |
OK |
Java 8 |
TESTS |
49 |
202 |
16076800 |
|
1900 |
21117446 |
Musin |
D |
Oct. 2, 2016, 2:29 p.m. |
OK |
Java 8 |
TESTS |
49 |
373 |
0 |
|
1900 |
21120207 |
rahulkhairwar |
D |
Oct. 2, 2016, 4:36 p.m. |
OK |
Java 8 |
TESTS |
49 |
468 |
0 |
|
1900 |
21085134 |
IgorKoval |
D |
Oct. 1, 2016, 3:10 p.m. |
OK |
Java 8 |
TESTS |
49 |
483 |
16486400 |
|
1900 |
69045880 |
chojh1222 |
D |
Jan. 18, 2020, 11:02 a.m. |
OK |
Java 8 |
TESTS |
49 |
499 |
0 |
|
1900 |
21096635 |
baobab |
D |
Oct. 1, 2016, 7:43 p.m. |
OK |
Java 8 |
TESTS |
49 |
514 |
0 |
|
1900 |
21078936 |
pitfall |
D |
Oct. 1, 2016, 2:36 p.m. |
OK |
Java 8 |
TESTS |
49 |
514 |
0 |
|
1900 |
21087815 |
Dekacc |
D |
Oct. 1, 2016, 3:30 p.m. |
OK |
Java 8 |
TESTS |
49 |
561 |
0 |
|
1900 |
21094283 |
abdo_shabrawy |
D |
Oct. 1, 2016, 5:27 p.m. |
OK |
Java 8 |
TESTS |
49 |
576 |
0 |
|
1900 |
21169609 |
AlexFetisov |
D |
Oct. 3, 2016, 5:51 p.m. |
OK |
Java 8 |
TESTS |
49 |
576 |
13824000 |
|
1900 |
21266733 |
dyukha |
D |
Oct. 7, 2016, 8:39 p.m. |
OK |
Kotlin |
TESTS |
49 |
763 |
23347200 |
|
1900 |
21125122 |
Spi |
D |
Oct. 2, 2016, 9:16 p.m. |
OK |
MS C# |
TESTS |
49 |
217 |
12595200 |
|
1900 |
21094607 |
AnatolyTolstobrov |
D |
Oct. 1, 2016, 5:41 p.m. |
OK |
MS C# |
TESTS |
49 |
296 |
8908800 |
|
1900 |
21094675 |
AnatolyTolstobrov |
D |
Oct. 1, 2016, 5:44 p.m. |
OK |
MS C# |
TESTS |
49 |
343 |
8806400 |
|
1900 |
21080989 |
azukun |
D |
Oct. 1, 2016, 2:45 p.m. |
OK |
MS C# |
TESTS |
49 |
436 |
10854400 |
|
1900 |
21086515 |
Tollentino |
D |
Oct. 1, 2016, 3:20 p.m. |
OK |
MS C# |
TESTS |
49 |
467 |
10444800 |
|
1900 |
22513515 |
og.kostya |
D |
Nov. 26, 2016, 4:44 p.m. |
OK |
MS C# |
TESTS |
49 |
982 |
32563200 |
|
1900 |
21461046 |
bohak.adi |
D |
Oct. 15, 2016, 3:27 p.m. |
OK |
MS C# |
TESTS |
49 |
1325 |
22835200 |
|
1900 |
21432024 |
wp32pw |
D |
Oct. 14, 2016, 7:44 p.m. |
OK |
MS C++ |
TESTS |
49 |
187 |
28057600 |
|
1900 |
47784021 |
vjudge1 |
D |
Dec. 31, 2018, 9:41 a.m. |
OK |
MS C++ |
TESTS |
49 |
217 |
1638400 |
|
1900 |
21202750 |
dimsol |
D |
Oct. 5, 2016, 7:03 a.m. |
OK |
MS C++ |
TESTS |
49 |
217 |
2048000 |
|
1900 |
21088573 |
xcdxcdxcd |
D |
Oct. 1, 2016, 3:36 p.m. |
OK |
MS C++ |
TESTS |
49 |
233 |
1638400 |
|
1900 |
21088865 |
Taube |
D |
Oct. 1, 2016, 3:38 p.m. |
OK |
MS C++ |
TESTS |
49 |
233 |
4608000 |
|
1900 |
21084336 |
Hujiwara |
D |
Oct. 1, 2016, 3:05 p.m. |
OK |
MS C++ |
TESTS |
49 |
249 |
1638400 |
|
1900 |
21080767 |
Perforator |
D |
Oct. 1, 2016, 2:44 p.m. |
OK |
MS C++ |
TESTS |
49 |
249 |
1843200 |
|
1900 |
21086035 |
amethyst3 |
D |
Oct. 1, 2016, 3:16 p.m. |
OK |
MS C++ |
TESTS |
49 |
249 |
2457600 |
|
1900 |
41250365 |
CrashMaster |
D |
Aug. 5, 2018, 3:46 p.m. |
OK |
MS C++ |
TESTS |
49 |
264 |
1638400 |
|
1900 |
21108980 |
Flowersea |
D |
Oct. 2, 2016, 8:16 a.m. |
OK |
MS C++ |
TESTS |
49 |
280 |
1638400 |
|
1900 |
21086495 |
xqxm |
D |
Oct. 1, 2016, 3:19 p.m. |
OK |
PyPy 2 |
TESTS |
49 |
467 |
10342400 |
|
1900 |
21110278 |
pho |
D |
Oct. 2, 2016, 9:14 a.m. |
OK |
PyPy 2 |
TESTS |
49 |
498 |
23552000 |
|
1900 |
21095018 |
nwi |
D |
Oct. 1, 2016, 5:59 p.m. |
OK |
PyPy 2 |
TESTS |
49 |
577 |
24576000 |
|
1900 |
40553548 |
pavankatta |
D |
July 19, 2018, 4:12 p.m. |
OK |
PyPy 2 |
TESTS |
49 |
950 |
12800000 |
|
1900 |
21209500 |
abhigupta4 |
D |
Oct. 5, 2016, 1:28 p.m. |
OK |
PyPy 2 |
TESTS |
49 |
950 |
21504000 |
|
1900 |
42152384 |
Onesh0t |
D |
Aug. 27, 2018, 12:51 p.m. |
OK |
PyPy 2 |
TESTS |
49 |
1169 |
21401600 |
|
1900 |
61221618 |
uno20001 |
D |
Sept. 24, 2019, 2:05 p.m. |
OK |
PyPy 3 |
TESTS |
49 |
1341 |
74649600 |
|
1900 |
21447285 |
orailly |
D |
Oct. 15, 2016, 9:51 a.m. |
OK |
Python 3 |
TESTS |
49 |
733 |
27136000 |
|
1900 |
21085085 |
limed |
D |
Oct. 1, 2016, 3:10 p.m. |
OK |
Scala |
TESTS |
49 |
1076 |
512000 |
|
1900 |
21470887 |
murphyfur |
D |
Oct. 16, 2016, 2:55 a.m. |
OK |
Scala |
TESTS |
49 |
1918 |
70041600 |
|
1900 |
remove filters
Back to search problems