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 two strings s and t consisting of small Latin letters, string s can also contain '? ' characters. Suitability of string s is calculated by following metric: Any two letters can be swapped positions, these operations can be performed arbitrary number of times over any pair of positions. Among all resulting strings s, you choose the one with the largest number of non-intersecting occurrences of string t. Suitability is this number of occurrences. You should replace all '? ' characters with small Latin letters in such a way that the suitability of string s is maximal. The first line contains string s (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106). The second line contains string t (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|t| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106). Print string s with '? ' replaced with small Latin letters in such a way that suitability of that string is maximal. If there are multiple strings with maximal suitability then print any of them. In the first example string "baab" can be transformed to "abab" with swaps, this one has suitability of 2. That means that string "baab" also has suitability of 2. In the second example maximal suitability you can achieve is 1 and there are several dozens of such strings, "azbz" is just one of them. In the third example there are no '? ' characters and the suitability of the string is 0. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
28607573 |
fluffyowl |
D |
July 16, 2017, 4:01 p.m. |
OK |
D |
TESTS |
24 |
46 |
7168000 |
|
1600 |
28690154 |
tgehr |
D |
July 19, 2017, 8:25 a.m. |
OK |
D |
TESTS |
24 |
312 |
14540800 |
|
1600 |
28622988 |
ruban |
D |
July 17, 2017, 1:37 a.m. |
OK |
Delphi |
TESTS |
24 |
795 |
230092800 |
|
1600 |
29451231 |
dailong |
D |
Aug. 14, 2017, 7:23 a.m. |
OK |
FPC |
TESTS |
24 |
31 |
9420800 |
|
1600 |
28612462 |
WARenie |
D |
July 16, 2017, 4:42 p.m. |
OK |
FPC |
TESTS |
24 |
46 |
7577600 |
|
1600 |
38821620 |
chaorenhaha |
D |
June 1, 2018, 7:56 a.m. |
OK |
FPC |
TESTS |
24 |
46 |
8806400 |
|
1600 |
38911519 |
chaorenhaha |
D |
June 3, 2018, 6:31 a.m. |
OK |
FPC |
TESTS |
24 |
62 |
8806400 |
|
1600 |
41333476 |
chaorenhaha |
D |
Aug. 8, 2018, 10:20 a.m. |
OK |
FPC |
TESTS |
24 |
109 |
5734400 |
|
1600 |
38822417 |
chaorenhaha |
D |
June 1, 2018, 8:32 a.m. |
OK |
FPC |
TESTS |
24 |
109 |
8806400 |
|
1600 |
28758252 |
jkxjkx1031 |
D |
July 21, 2017, 2:53 p.m. |
OK |
GNU C |
TESTS |
24 |
155 |
4915200 |
|
1600 |
29430849 |
JeffreyLC |
D |
Aug. 13, 2017, 10:29 a.m. |
OK |
GNU C++ |
TESTS |
24 |
30 |
3891200 |
|
1600 |
30230639 |
bestFy |
D |
Sept. 9, 2017, 5:03 p.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
1843200 |
|
1600 |
32005120 |
vjudge5 |
D |
Nov. 3, 2017, 11:09 a.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
1945600 |
|
1600 |
31868879 |
meJVJ |
D |
Oct. 29, 2017, 2:02 p.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
2048000 |
|
1600 |
30226365 |
vjudge5 |
D |
Sept. 9, 2017, 1:10 p.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
2048000 |
|
1600 |
28613073 |
Y_AMTUCS |
D |
July 16, 2017, 4:49 p.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
3891200 |
|
1600 |
29495401 |
vjudge4 |
D |
Aug. 16, 2017, 3:37 a.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
4096000 |
|
1600 |
29495395 |
Bcc |
D |
Aug. 16, 2017, 3:36 a.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
4096000 |
|
1600 |
29163057 |
faebdc |
D |
Aug. 3, 2017, 3:41 p.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
4096000 |
|
1600 |
28983121 |
rajeshkumarsinha12 |
D |
July 30, 2017, 5:41 a.m. |
OK |
GNU C++ |
TESTS |
24 |
31 |
4096000 |
|
1600 |
28897817 |
shailesh_jha |
D |
July 26, 2017, 7:56 a.m. |
OK |
GNU C11 |
TESTS |
24 |
78 |
3891200 |
|
1600 |
28613822 |
sgtlaugh |
D |
July 16, 2017, 4:56 p.m. |
OK |
GNU C11 |
TESTS |
24 |
93 |
7884800 |
|
1600 |
28612874 |
TheQueen |
D |
July 16, 2017, 4:47 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
30 |
4812800 |
|
1600 |
28733660 |
yusayura |
D |
July 20, 2017, 8:46 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
30 |
4812800 |
|
1600 |
28604011 |
scopeInfinity |
D |
July 16, 2017, 3:37 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
30 |
8192000 |
|
1600 |
28928018 |
Amanita |
D |
July 27, 2017, 10:38 a.m. |
OK |
GNU C++11 |
TESTS |
24 |
30 |
10547200 |
|
1600 |
62596933 |
He_Ren |
D |
Oct. 15, 2019, 2:33 a.m. |
OK |
GNU C++11 |
TESTS |
24 |
31 |
1843200 |
|
1600 |
30891543 |
rprtr258 |
D |
Sept. 30, 2017, 11 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
31 |
2048000 |
|
1600 |
50819500 |
d.j6082013 |
D |
March 5, 2019, 12:57 p.m. |
OK |
GNU C++11 |
TESTS |
24 |
31 |
2048000 |
|
1600 |
31214517 |
JNS |
D |
Oct. 11, 2017, 11:24 a.m. |
OK |
GNU C++11 |
TESTS |
24 |
31 |
2969600 |
|
1600 |
31214507 |
JNS |
D |
Oct. 11, 2017, 11:24 a.m. |
OK |
GNU C++11 |
TESTS |
24 |
31 |
2969600 |
|
1600 |
28633872 |
King_of_Paladins |
D |
July 17, 2017, 8:44 a.m. |
OK |
GNU C++11 |
TESTS |
24 |
31 |
3891200 |
|
1600 |
28604963 |
0ogway |
D |
July 16, 2017, 3:43 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
3891200 |
|
1600 |
29032110 |
md.ashif313 |
D |
July 31, 2017, 2:23 a.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
4710400 |
|
1600 |
28614665 |
piyushjain1 |
D |
July 16, 2017, 5:04 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
4710400 |
|
1600 |
28606384 |
Momentum |
D |
July 16, 2017, 3:53 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
4710400 |
|
1600 |
29156341 |
SarvagyaAgarwal |
D |
Aug. 3, 2017, 1:28 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
4710400 |
|
1600 |
28615702 |
Ranis |
D |
July 16, 2017, 5:25 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
8499200 |
|
1600 |
35790935 |
cordercorder |
D |
Feb. 28, 2018, 4:24 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
10342400 |
|
1600 |
28601774 |
arsijo |
D |
July 16, 2017, 3:24 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
10444800 |
|
1600 |
28609911 |
StillANoob |
D |
July 16, 2017, 4:20 p.m. |
OK |
GNU C++14 |
TESTS |
24 |
30 |
10444800 |
|
1600 |
39533797 |
pushkar12 |
D |
June 23, 2018, 6:33 a.m. |
OK |
GNU C++14 |
TESTS |
24 |
31 |
2764800 |
|
1600 |
42281654 |
dmkozyrev |
D |
Aug. 30, 2018, 2:32 p.m. |
OK |
GNU C++17 |
TESTS |
24 |
31 |
2764800 |
|
1600 |
58371665 |
kaike |
D |
Aug. 6, 2019, 6:48 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
31 |
2969600 |
|
1600 |
58370788 |
emmmmmm |
D |
Aug. 6, 2019, 6:28 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
31 |
6041600 |
|
1600 |
58399780 |
k0walsk1 |
D |
Aug. 6, 2019, 5:13 p.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2048000 |
|
1600 |
63396147 |
BabaYaga42 |
D |
Oct. 25, 2019, 4:44 p.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2048000 |
|
1600 |
59200427 |
Hacheylight |
D |
Aug. 21, 2019, 4:24 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2048000 |
|
1600 |
58411909 |
w42729 |
D |
Aug. 7, 2019, 2:12 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2048000 |
|
1600 |
58377961 |
bananala |
D |
Aug. 6, 2019, 8:53 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2048000 |
|
1600 |
47518225 |
QieziMin |
D |
Dec. 26, 2018, 11:22 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2048000 |
|
1600 |
42755299 |
vjudge1 |
D |
Sept. 11, 2018, 6:30 a.m. |
OK |
GNU C++17 |
TESTS |
24 |
46 |
2355200 |
|
1600 |
29118551 |
megaspazz |
D |
Aug. 2, 2017, 5:54 a.m. |
OK |
Go |
TESTS |
24 |
93 |
29491200 |
|
1600 |
28645364 |
sl0th |
D |
July 17, 2017, 5:26 p.m. |
OK |
Haskell |
TESTS |
24 |
342 |
111206400 |
|
1600 |
28645591 |
sl0th |
D |
July 17, 2017, 5:39 p.m. |
OK |
Haskell |
TESTS |
24 |
343 |
112230400 |
|
1600 |
68143764 |
bluesky111 |
D |
Jan. 4, 2020, 2:18 a.m. |
OK |
Java 8 |
TESTS |
24 |
140 |
0 |
|
1600 |
59439874 |
adeepgarg13 |
D |
Aug. 25, 2019, 10:42 a.m. |
OK |
Java 8 |
TESTS |
24 |
140 |
0 |
|
1600 |
54213241 |
vjudge1 |
D |
May 15, 2019, 6:23 p.m. |
OK |
Java 8 |
TESTS |
24 |
140 |
2252800 |
|
1600 |
47860044 |
llamaoo7 |
D |
Jan. 3, 2019, 5:13 a.m. |
OK |
Java 8 |
TESTS |
24 |
140 |
5120000 |
|
1600 |
29846076 |
mDziewanowski |
D |
Aug. 28, 2017, 1:11 p.m. |
OK |
Java 8 |
TESTS |
24 |
140 |
5324800 |
|
1600 |
28608051 |
fnch |
D |
July 16, 2017, 4:05 p.m. |
OK |
Java 8 |
TESTS |
24 |
140 |
21606400 |
|
1600 |
55238595 |
sameep17264 |
D |
June 7, 2019, 9:40 a.m. |
OK |
Java 8 |
TESTS |
24 |
155 |
0 |
|
1600 |
53585804 |
martins |
D |
April 30, 2019, 6:26 p.m. |
OK |
Java 8 |
TESTS |
24 |
155 |
2252800 |
|
1600 |
66747414 |
unicorn20141 |
D |
Dec. 13, 2019, 3:40 a.m. |
OK |
Java 8 |
TESTS |
24 |
155 |
3072000 |
|
1600 |
28616458 |
PrakharJain |
D |
July 16, 2017, 5:50 p.m. |
OK |
Java 8 |
TESTS |
24 |
155 |
21708800 |
|
1600 |
28621239 |
ldt116 |
D |
July 16, 2017, 11:12 p.m. |
OK |
Kotlin |
TESTS |
24 |
265 |
23142400 |
|
1600 |
28856132 |
Sergey.Bankevich |
D |
July 24, 2017, 7:02 p.m. |
OK |
Kotlin |
TESTS |
24 |
405 |
23244800 |
|
1600 |
28806440 |
ramil.agger |
D |
July 23, 2017, 6:17 p.m. |
OK |
Kotlin |
TESTS |
24 |
686 |
28057600 |
|
1600 |
28607249 |
leign |
D |
July 16, 2017, 3:59 p.m. |
OK |
Mono C# |
TESTS |
24 |
93 |
17100800 |
|
1600 |
28613369 |
kuuso |
D |
July 16, 2017, 4:52 p.m. |
OK |
Mono C# |
TESTS |
24 |
108 |
26624000 |
|
1600 |
28608486 |
claw88 |
D |
July 16, 2017, 4:08 p.m. |
OK |
Mono C# |
TESTS |
24 |
140 |
18432000 |
|
1600 |
51103665 |
ShadowLP |
D |
March 9, 2019, 8:29 p.m. |
OK |
Mono C# |
TESTS |
24 |
623 |
11571200 |
|
1600 |
29412312 |
og.kostya |
D |
Aug. 12, 2017, 6:24 p.m. |
OK |
MS C# |
TESTS |
24 |
77 |
16179200 |
|
1600 |
28613179 |
BIT |
D |
July 16, 2017, 4:50 p.m. |
OK |
MS C# |
TESTS |
24 |
93 |
18841600 |
|
1600 |
28687439 |
luka25 |
D |
July 19, 2017, 6:59 a.m. |
OK |
MS C# |
TESTS |
24 |
93 |
20172800 |
|
1600 |
28749542 |
AnatolyTolstobrov |
D |
July 21, 2017, 12:16 p.m. |
OK |
MS C# |
TESTS |
24 |
93 |
21401600 |
|
1600 |
28610959 |
artsin666 |
D |
July 16, 2017, 4:28 p.m. |
OK |
MS C# |
TESTS |
24 |
93 |
29081600 |
|
1600 |
28608422 |
claw88 |
D |
July 16, 2017, 4:08 p.m. |
OK |
MS C# |
TESTS |
24 |
140 |
18432000 |
|
1600 |
28636611 |
fr0st |
D |
July 17, 2017, 10:36 a.m. |
OK |
MS C# |
TESTS |
24 |
155 |
18944000 |
|
1600 |
28612919 |
Meternal |
D |
July 16, 2017, 4:47 p.m. |
OK |
MS C# |
TESTS |
24 |
202 |
17305600 |
|
1600 |
32908344 |
Liran |
D |
Dec. 3, 2017, 9:07 p.m. |
OK |
MS C# |
TESTS |
24 |
327 |
19148800 |
|
1600 |
29299983 |
indielife |
D |
Aug. 9, 2017, 7:03 a.m. |
OK |
MS C++ |
TESTS |
24 |
31 |
4096000 |
|
1600 |
28603459 |
LLI_E_P_JI_O_K |
D |
July 16, 2017, 3:34 p.m. |
OK |
MS C++ |
TESTS |
24 |
31 |
6348800 |
|
1600 |
29298604 |
indielife |
D |
Aug. 9, 2017, 5:43 a.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
4096000 |
|
1600 |
35827559 |
vjudge5 |
D |
March 2, 2018, 7:03 a.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
4198400 |
|
1600 |
44430561 |
vjudge3 |
D |
Oct. 17, 2018, 7:25 a.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
4300800 |
|
1600 |
28613040 |
merzgling |
D |
July 16, 2017, 4:48 p.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
5222400 |
|
1600 |
28758008 |
egj1996 |
D |
July 21, 2017, 2:39 p.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
5222400 |
|
1600 |
28720565 |
Ancient_mage |
D |
July 20, 2017, 9:46 a.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
5222400 |
|
1600 |
28684767 |
linghongyi |
D |
July 19, 2017, 5:13 a.m. |
OK |
MS C++ |
TESTS |
24 |
46 |
11468800 |
|
1600 |
29299708 |
indielife |
D |
Aug. 9, 2017, 6:48 a.m. |
OK |
MS C++ |
TESTS |
24 |
61 |
4096000 |
|
1600 |
60355160 |
Still_Theory |
D |
Sept. 10, 2019, 3:51 p.m. |
OK |
MS C++ 2017 |
TESTS |
24 |
78 |
3174400 |
|
1600 |
35068386 |
mayakin |
D |
Feb. 8, 2018, 5:57 p.m. |
OK |
PHP |
TESTS |
24 |
373 |
9625600 |
|
1600 |
28648478 |
Alsagen |
D |
July 17, 2017, 8:24 p.m. |
OK |
PHP |
TESTS |
24 |
561 |
49664000 |
|
1600 |
28648693 |
Alsagen |
D |
July 17, 2017, 8:40 p.m. |
OK |
PHP |
TESTS |
24 |
576 |
51712000 |
|
1600 |
28619232 |
BenL |
D |
July 16, 2017, 8:14 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
264 |
69017600 |
|
1600 |
28610669 |
Noureldin |
D |
July 16, 2017, 4:26 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
265 |
50892800 |
|
1600 |
28783246 |
Ostkaka |
D |
July 22, 2017, 4:33 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
280 |
66252800 |
|
1600 |
28601582 |
Lewin |
D |
July 16, 2017, 3:23 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
280 |
66252800 |
|
1600 |
28601351 |
--d |
D |
July 16, 2017, 3:21 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
514 |
60416000 |
|
1600 |
28625604 |
BenL |
D |
July 17, 2017, 4:03 a.m. |
OK |
PyPy 2 |
TESTS |
24 |
514 |
68915200 |
|
1600 |
41337759 |
Onesh0t |
D |
Aug. 8, 2018, 1:15 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
561 |
50995200 |
|
1600 |
31192361 |
shub.jain |
D |
Oct. 10, 2017, 2:23 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
577 |
51097600 |
|
1600 |
30580129 |
andreamaf |
D |
Sept. 21, 2017, 2:07 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
654 |
33587200 |
|
1600 |
40556394 |
aeternalis1 |
D |
July 19, 2018, 6:25 p.m. |
OK |
PyPy 2 |
TESTS |
24 |
685 |
62464000 |
|
1600 |
38148393 |
drisskhalil15 |
D |
May 12, 2018, 9:19 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
420 |
78950400 |
|
1600 |
32535516 |
yugle7 |
D |
Nov. 21, 2017, 8:40 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
499 |
51097600 |
|
1600 |
28617226 |
sobir_bobiev |
D |
July 16, 2017, 6:23 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
514 |
68198400 |
|
1600 |
55314200 |
artifexbm |
D |
June 8, 2019, 7:52 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
530 |
57856000 |
|
1600 |
56053618 |
knight-erraunt |
D |
June 25, 2019, 8:59 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
546 |
34918400 |
|
1600 |
28907223 |
the_silliest |
D |
July 26, 2017, 2:23 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
546 |
96256000 |
|
1600 |
28617793 |
sobir_bobiev |
D |
July 16, 2017, 6:52 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
592 |
74035200 |
|
1600 |
28737127 |
pragy |
D |
July 21, 2017, 2:25 a.m. |
OK |
PyPy 3 |
TESTS |
24 |
607 |
67379200 |
|
1600 |
28601227 |
--d |
D |
July 16, 2017, 3:21 p.m. |
OK |
PyPy 3 |
TESTS |
24 |
717 |
68300800 |
|
1600 |
59262811 |
iamssk |
D |
Aug. 22, 2019, 9:19 a.m. |
OK |
PyPy 3 |
TESTS |
24 |
779 |
66150400 |
|
1600 |
28664807 |
aniket3167 |
D |
July 18, 2017, 10:18 a.m. |
OK |
Python 2 |
TESTS |
24 |
997 |
19558400 |
|
1600 |
28693969 |
usov0102 |
D |
July 19, 2017, 10:54 a.m. |
OK |
Python 3 |
TESTS |
24 |
514 |
8499200 |
|
1600 |
56053607 |
knight-erraunt |
D |
June 25, 2019, 8:59 p.m. |
OK |
Python 3 |
TESTS |
24 |
686 |
9728000 |
|
1600 |
34506040 |
Kartofan180 |
D |
Jan. 24, 2018, 6:49 a.m. |
OK |
Python 3 |
TESTS |
24 |
889 |
15564800 |
|
1600 |
34478562 |
loochek |
D |
Jan. 23, 2018, 10:50 a.m. |
OK |
Python 3 |
TESTS |
24 |
997 |
14131200 |
|
1600 |
29278234 |
Hillmouse |
D |
Aug. 8, 2017, 5:42 a.m. |
OK |
Rust |
TESTS |
24 |
140 |
5529600 |
|
1600 |
remove filters
Back to search problems