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'Mr. Kitayuta has kindly given you a string s consisting of lowercase English letters. You are asked to insert exactly n lowercase English letters into s to make it a palindrome. (A palindrome is a string that reads the same forward and backward. For example, "noon", "testset" and "a" are all palindromes, while "test" and "kitayuta" are not.) You can choose any n lowercase English letters, and insert each of them to any position of s, possibly to the beginning or the end of s. You have to insert exactly n letters even if it is possible to turn s into a palindrome by inserting less than n letters. Find the number of the palindromes that can be obtained in this way, modulo 10007. The first line contains a string s (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200). Each character in s is a lowercase English letter. The second line contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Print the number of the palindromes that can be obtained, modulo 10007. For the first sample, you can obtain the palindrome "reviver" by inserting 'r ' to the end of "revive". For the second sample, the following 28 palindromes can be obtained: "adada", "adbda", ..., "adzda", "dadad" and "ddadd".'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
10737408 |
yubaby |
E |
April 16, 2015, 3:24 a.m. |
OK |
FPC |
TESTS |
134 |
1949 |
35020800 |
|
2900 |
10748640 |
louisja1 |
E |
April 17, 2015, 7:25 a.m. |
OK |
FPC |
TESTS |
134 |
2011 |
37068800 |
|
2900 |
31617574 |
dwjshift |
E |
Oct. 23, 2017, 1:57 a.m. |
OK |
GNU C++ |
TESTS |
134 |
93 |
57036800 |
|
2900 |
31617539 |
dwjshift |
E |
Oct. 23, 2017, 1:52 a.m. |
OK |
GNU C++ |
TESTS |
134 |
109 |
92467200 |
|
2900 |
31600861 |
dwjshift |
E |
Oct. 22, 2017, 10:43 a.m. |
OK |
GNU C++ |
TESTS |
134 |
109 |
92467200 |
|
2900 |
31617526 |
dwjshift |
E |
Oct. 23, 2017, 1:50 a.m. |
OK |
GNU C++ |
TESTS |
134 |
124 |
92467200 |
|
2900 |
33899311 |
Claris |
E |
Jan. 4, 2018, 9:06 a.m. |
OK |
GNU C++ |
TESTS |
134 |
140 |
126976000 |
|
2900 |
33899242 |
Claris |
E |
Jan. 4, 2018, 9:01 a.m. |
OK |
GNU C++ |
TESTS |
134 |
156 |
126976000 |
|
2900 |
33899229 |
Claris |
E |
Jan. 4, 2018, 9 a.m. |
OK |
GNU C++ |
TESTS |
134 |
202 |
126976000 |
|
2900 |
9484004 |
krijgertje |
E |
Jan. 20, 2015, 11:40 a.m. |
OK |
GNU C++ |
TESTS |
134 |
607 |
18432000 |
|
2900 |
31497989 |
dwjshift |
E |
Oct. 19, 2017, 5:11 a.m. |
OK |
GNU C++ |
TESTS |
134 |
670 |
41779200 |
|
2900 |
10640967 |
Prime21 |
E |
April 9, 2015, 2:26 p.m. |
OK |
GNU C++ |
TESTS |
134 |
826 |
36044800 |
|
2900 |
9501177 |
evima |
E |
Jan. 22, 2015, 10:57 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
109 |
49561600 |
|
2900 |
10157879 |
Los_Angelos_Laycurse |
E |
March 5, 2015, 8:40 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
155 |
45977600 |
|
2900 |
10254531 |
Los_Angelos_Laycurse |
E |
March 13, 2015, 7:18 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
156 |
45875200 |
|
2900 |
10158028 |
Los_Angelos_Laycurse |
E |
March 5, 2015, 8:55 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
156 |
45977600 |
|
2900 |
9536344 |
tomasz.kociumaka |
E |
Jan. 24, 2015, 9:26 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
218 |
51302400 |
|
2900 |
9501164 |
evima |
E |
Jan. 22, 2015, 10:55 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
826 |
36044800 |
|
2900 |
9596570 |
No_Use_Anymore |
E |
Jan. 28, 2015, 3:10 a.m. |
OK |
GNU C++0x |
TESTS |
134 |
841 |
36044800 |
|
2900 |
9812271 |
zxc901 |
E |
Feb. 12, 2015, 11:36 p.m. |
OK |
GNU C++0x |
TESTS |
134 |
841 |
47820800 |
|
2900 |
9603800 |
No_Use_Anymore |
E |
Jan. 28, 2015, 2:26 p.m. |
OK |
GNU C++0x |
TESTS |
134 |
842 |
36044800 |
|
2900 |
9594794 |
No_Use_Anymore |
E |
Jan. 27, 2015, 10:33 p.m. |
OK |
GNU C++0x |
TESTS |
134 |
842 |
36044800 |
|
2900 |
54807094 |
monsoon |
E |
May 29, 2019, 2:45 p.m. |
OK |
GNU C++11 |
TESTS |
134 |
62 |
37683200 |
|
2900 |
40987432 |
ReaLNero1 |
E |
July 30, 2018, 9:15 p.m. |
OK |
GNU C++11 |
TESTS |
134 |
109 |
49561600 |
|
2900 |
63110855 |
cjy2003 |
E |
Oct. 22, 2019, 7:22 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
124 |
204800 |
|
2900 |
17165985 |
RNS3 |
E |
April 5, 2016, 3:57 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
124 |
51814400 |
|
2900 |
33899268 |
TLE |
E |
Jan. 4, 2018, 9:03 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
124 |
134553600 |
|
2900 |
33899329 |
Claris |
E |
Jan. 4, 2018, 9:07 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
140 |
126976000 |
|
2900 |
33899411 |
Claris |
E |
Jan. 4, 2018, 9:12 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
155 |
126976000 |
|
2900 |
64774084 |
zx2003 |
E |
Nov. 13, 2019, 2:44 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
171 |
409600 |
|
2900 |
69726261 |
weng_233 |
E |
Jan. 29, 2020, 12:21 p.m. |
OK |
GNU C++11 |
TESTS |
134 |
187 |
409600 |
|
2900 |
51213235 |
jefflyy |
E |
March 12, 2019, 9:04 a.m. |
OK |
GNU C++11 |
TESTS |
134 |
249 |
204800 |
|
2900 |
32522994 |
apiadu |
E |
Nov. 21, 2017, 11:14 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
109 |
399155200 |
|
2900 |
51159829 |
mayaohua2003 |
E |
March 11, 2019, 11:52 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
140 |
137318400 |
|
2900 |
33470698 |
whzzt |
E |
Dec. 21, 2017, 5:12 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
155 |
540057600 |
|
2900 |
33470664 |
whzzt |
E |
Dec. 21, 2017, 5:09 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
202 |
540057600 |
|
2900 |
64719147 |
nqiiii |
E |
Nov. 12, 2019, 1:54 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
218 |
1126400 |
|
2900 |
63904118 |
Cyanic |
E |
Oct. 31, 2019, 5:58 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
249 |
141004800 |
|
2900 |
42278743 |
Vatinkriv |
E |
Aug. 30, 2018, 1:06 p.m. |
OK |
GNU C++14 |
TESTS |
134 |
249 |
164044800 |
|
2900 |
39353387 |
FallDream |
E |
June 18, 2018, 10:29 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
265 |
36556800 |
|
2900 |
46047254 |
cz_xuyixuan |
E |
Nov. 22, 2018, 3:43 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
265 |
140697600 |
|
2900 |
53893142 |
XZA |
E |
May 9, 2019, 2:53 a.m. |
OK |
GNU C++14 |
TESTS |
134 |
265 |
141004800 |
|
2900 |
62172428 |
xgcxgc |
E |
Oct. 9, 2019, 1:56 a.m. |
OK |
GNU C++17 |
TESTS |
134 |
46 |
33177600 |
|
2900 |
63064519 |
Elegia |
E |
Oct. 21, 2019, 10:16 a.m. |
OK |
GNU C++17 |
TESTS |
134 |
62 |
111308800 |
|
2900 |
63404030 |
saketh |
E |
Oct. 25, 2019, 7:29 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
109 |
819200 |
|
2900 |
63410284 |
saketh |
E |
Oct. 25, 2019, 11:25 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
124 |
921600 |
|
2900 |
63403750 |
saketh |
E |
Oct. 25, 2019, 7:23 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
124 |
921600 |
|
2900 |
63410324 |
saketh |
E |
Oct. 25, 2019, 11:28 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
124 |
1024000 |
|
2900 |
63403482 |
saketh |
E |
Oct. 25, 2019, 7:17 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
139 |
1126400 |
|
2900 |
63403701 |
saketh |
E |
Oct. 25, 2019, 7:22 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
140 |
1024000 |
|
2900 |
63259886 |
saketh |
E |
Oct. 23, 2019, 7:44 p.m. |
OK |
GNU C++17 |
TESTS |
134 |
202 |
1024000 |
|
2900 |
60287255 |
Benq |
E |
Sept. 9, 2019, 3:53 a.m. |
OK |
GNU C++17 |
TESTS |
134 |
327 |
248524800 |
|
2900 |
9466347 |
winger |
E |
Jan. 18, 2015, 5:12 p.m. |
OK |
Java 8 |
TESTS |
134 |
3556 |
47513600 |
|
2900 |
9464043 |
Petr |
E |
Jan. 18, 2015, 2:48 p.m. |
OK |
Java 8 |
TESTS |
134 |
4367 |
11571200 |
|
2900 |
9482390 |
galois25 |
E |
Jan. 20, 2015, 7:45 a.m. |
OK |
MS C++ |
TESTS |
134 |
140 |
32768000 |
|
2900 |
10157875 |
Los_Angelos_Laycurse |
E |
March 5, 2015, 8:39 a.m. |
OK |
MS C++ |
TESTS |
134 |
202 |
45977600 |
|
2900 |
10157864 |
Los_Angelos_Laycurse |
E |
March 5, 2015, 8:38 a.m. |
OK |
MS C++ |
TESTS |
134 |
202 |
45977600 |
|
2900 |
10157818 |
Los_Angelos_Laycurse |
E |
March 5, 2015, 8:34 a.m. |
OK |
MS C++ |
TESTS |
134 |
202 |
45977600 |
|
2900 |
10157740 |
Los_Angelos_Laycurse |
E |
March 5, 2015, 8:27 a.m. |
OK |
MS C++ |
TESTS |
134 |
576 |
91955200 |
|
2900 |
47898407 |
LLI_E_P_JI_O_K |
E |
Jan. 4, 2019, 12:25 p.m. |
OK |
MS C++ |
TESTS |
134 |
2589 |
464281600 |
|
2900 |
remove filters
Back to search problems