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'A string a of length m is called antipalindromic iff m is even, and for each i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m) ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89am xe2 x80 x89- xe2 x80 x89i xe2 x80 x89+ xe2 x80 x891. Ivan has a string s consisting of n lowercase Latin letters; n is even. He wants to form some string t that will be an antipalindromic permutation of s. Also Ivan has denoted the beauty of index i as bi, and the beauty of t as the sum of bi among all indices i such that si xe2 x80 x89= xe2 x80 x89ti. Help Ivan to determine maximum possible beauty of t he can get. The first line contains one integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100, n is even) -- the number of characters in s. The second line contains the string s itself. It consists of only lowercase Latin letters, and it is guaranteed that its letters can be reordered to form an antipalindromic string. The third line contains n integer numbers b1, b2, ..., bn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100), where bi is the beauty of index i. Print one number -- the maximum possible beauty of t. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
33051901 |
LeoPro |
F |
Dec. 9, 2017, 1:53 p.m. |
OK |
FPC |
TESTS |
122 |
31 |
1740800 |
|
2500 |
32150539 |
lasha_p92 |
F |
Nov. 9, 2017, 3:40 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
0 |
|
2500 |
32074306 |
Georgia_001 |
F |
Nov. 5, 2017, 11:12 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
0 |
|
2500 |
31950778 |
treeofapple |
F |
Nov. 1, 2017, 1:06 p.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
0 |
|
2500 |
32417056 |
Leonardo_Blanger |
F |
Nov. 18, 2017, 12:39 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
0 |
|
2500 |
31821909 |
Oxer11 |
F |
Oct. 28, 2017, 1:10 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
102400 |
|
2500 |
32035141 |
js00000000000000000 |
F |
Nov. 3, 2017, 7:45 p.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
716800 |
|
2500 |
32307418 |
prayerhgq |
F |
Nov. 14, 2017, 9:08 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
921600 |
|
2500 |
35141896 |
vjudge5 |
F |
Feb. 11, 2018, 3:55 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
1843200 |
|
2500 |
33760837 |
Worldwide_D |
F |
Dec. 29, 2017, 1:29 p.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
2457600 |
|
2500 |
35142309 |
vjudge1 |
F |
Feb. 11, 2018, 4:32 a.m. |
OK |
GNU C++ |
TESTS |
122 |
15 |
2764800 |
|
2500 |
68325543 |
rainboy |
F |
Jan. 6, 2020, 4:44 p.m. |
OK |
GNU C11 |
TESTS |
122 |
31 |
102400 |
|
2500 |
69058873 |
rainboy |
F |
Jan. 18, 2020, 3:38 p.m. |
OK |
GNU C11 |
TESTS |
122 |
31 |
102400 |
|
2500 |
32064539 |
krijgertje |
F |
Nov. 4, 2017, 10:14 p.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
31975745 |
rrah97 |
F |
Nov. 2, 2017, 10:38 a.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
31963222 |
yancouto |
F |
Nov. 1, 2017, 9:11 p.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
31907886 |
xyz.abc |
F |
Oct. 31, 2017, 12:02 a.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
31853646 |
Durant_Lee |
F |
Oct. 29, 2017, 1:41 a.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
31812602 |
AlanWaP |
F |
Oct. 27, 2017, 4:39 p.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
31808014 |
gisp_zjz |
F |
Oct. 27, 2017, 3:24 p.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
32378468 |
theodor.moroianu |
F |
Nov. 17, 2017, 12:46 p.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
32283479 |
lxy666 |
F |
Nov. 13, 2017, 12:14 p.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
0 |
|
2500 |
32047157 |
EsTer |
F |
Nov. 4, 2017, 8:55 a.m. |
OK |
GNU C++11 |
TESTS |
122 |
15 |
102400 |
|
2500 |
31983166 |
Jakube |
F |
Nov. 2, 2017, 2:24 p.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31919997 |
int3xcc |
F |
Oct. 31, 2017, 11:55 a.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31919384 |
aglovatto |
F |
Oct. 31, 2017, 11:33 a.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31900191 |
linsinn |
F |
Oct. 30, 2017, 4:49 p.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31896564 |
ze177482 |
F |
Oct. 30, 2017, 2:28 p.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31868799 |
nkang4 |
F |
Oct. 29, 2017, 1:59 p.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31856040 |
LiChenKoh |
F |
Oct. 29, 2017, 5 a.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31825432 |
ZhouTi |
F |
Oct. 28, 2017, 5:44 a.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
31997650 |
mengrao |
F |
Nov. 3, 2017, 5:10 a.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
32278726 |
wclee2265 |
F |
Nov. 13, 2017, 7:39 a.m. |
OK |
GNU C++14 |
TESTS |
122 |
15 |
0 |
|
2500 |
68572295 |
vjudge2 |
F |
Jan. 11, 2020, 3:03 a.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
0 |
|
2500 |
43388619 |
wjoao |
F |
Sept. 24, 2018, 10:22 p.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
0 |
|
2500 |
43388602 |
wjoao |
F |
Sept. 24, 2018, 10:20 p.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
0 |
|
2500 |
40211531 |
totsamyzed |
F |
July 11, 2018, 8:19 p.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
204800 |
|
2500 |
61689618 |
ankurdua15 |
F |
Oct. 2, 2019, 5:16 a.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
204800 |
|
2500 |
56859519 |
Vax |
F |
July 11, 2019, 8:49 p.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
307200 |
|
2500 |
56838630 |
Vax |
F |
July 11, 2019, 10:23 a.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
307200 |
|
2500 |
56838594 |
Vax |
F |
July 11, 2019, 10:22 a.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
307200 |
|
2500 |
62333751 |
nitixkrai |
F |
Oct. 10, 2019, 10:41 p.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
307200 |
|
2500 |
66427068 |
Mn619 |
F |
Dec. 6, 2019, 10:37 p.m. |
OK |
GNU C++17 |
TESTS |
122 |
31 |
307200 |
|
2500 |
68325541 |
Dukkha |
F |
Jan. 6, 2020, 4:44 p.m. |
OK |
Java 11 |
TESTS |
122 |
202 |
0 |
|
2500 |
69058872 |
Dukkha |
F |
Jan. 18, 2020, 3:38 p.m. |
OK |
Java 11 |
TESTS |
122 |
218 |
0 |
|
2500 |
53899008 |
jagmeet787 |
F |
May 9, 2019, 8 a.m. |
OK |
Java 8 |
TESTS |
122 |
124 |
0 |
|
2500 |
32077802 |
Dey |
F |
Nov. 5, 2017, 1:55 p.m. |
OK |
Java 8 |
TESTS |
122 |
124 |
0 |
|
2500 |
35179228 |
svilen |
F |
Feb. 12, 2018, 1:30 p.m. |
OK |
Java 8 |
TESTS |
122 |
139 |
20684800 |
|
2500 |
31921075 |
vjudge3 |
F |
Oct. 31, 2017, 12:35 p.m. |
OK |
Java 8 |
TESTS |
122 |
140 |
0 |
|
2500 |
32061941 |
fillinia |
F |
Nov. 4, 2017, 7:18 p.m. |
OK |
Java 8 |
TESTS |
122 |
140 |
0 |
|
2500 |
31819218 |
Juniorandrade |
F |
Oct. 27, 2017, 8:50 p.m. |
OK |
Java 8 |
TESTS |
122 |
140 |
0 |
|
2500 |
31808029 |
Ahmad_Elsagheer |
F |
Oct. 27, 2017, 3:24 p.m. |
OK |
Java 8 |
TESTS |
122 |
155 |
17203200 |
|
2500 |
35177218 |
svilen |
F |
Feb. 12, 2018, 12:19 p.m. |
OK |
Java 8 |
TESTS |
122 |
155 |
20684800 |
|
2500 |
32079988 |
sehun01 |
F |
Nov. 5, 2017, 3:55 p.m. |
OK |
Java 8 |
TESTS |
122 |
156 |
17100800 |
|
2500 |
31819545 |
uwi |
F |
Oct. 27, 2017, 9:16 p.m. |
OK |
Java 8 |
TESTS |
122 |
187 |
0 |
|
2500 |
31819539 |
ldt116 |
F |
Oct. 27, 2017, 9:15 p.m. |
OK |
Kotlin |
TESTS |
122 |
140 |
409600 |
|
2500 |
31819511 |
ldt116 |
F |
Oct. 27, 2017, 9:14 p.m. |
OK |
Kotlin |
TESTS |
122 |
171 |
409600 |
|
2500 |
31839401 |
AleksanderBalobanov |
F |
Oct. 28, 2017, 1:40 p.m. |
OK |
MS C++ |
TESTS |
122 |
30 |
1331200 |
|
2500 |
31805411 |
mmaxio |
F |
Oct. 27, 2017, 2:55 p.m. |
OK |
PyPy 3 |
TESTS |
122 |
108 |
307200 |
|
2500 |
32151613 |
siddharth.s.atwork |
F |
Nov. 9, 2017, 5:53 a.m. |
OK |
PyPy 3 |
TESTS |
122 |
109 |
307200 |
|
2500 |
39404697 |
Ali_Pi |
F |
June 19, 2018, 9:11 a.m. |
OK |
Python 2 |
TESTS |
122 |
124 |
102400 |
|
2500 |
31817664 |
.I. |
F |
Oct. 27, 2017, 7:33 p.m. |
OK |
Python 3 |
TESTS |
122 |
77 |
204800 |
|
2500 |
47872936 |
Charles_Han |
F |
Jan. 3, 2019, 1:50 p.m. |
OK |
Python 3 |
TESTS |
122 |
124 |
307200 |
|
2500 |
remove filters
Back to search problems