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
Scientists of planet Olympia are conducting an experiment in mutation of primitive organisms. Genome of organism from this planet can be represented as a string of the first K capital English letters. For each pair of types of genes they assigned a i , j — a risk of disease occurence in the organism provided that genes of these types are adjacent in the genome, where i — the 1-based index of the first gene and j — the index of the second gene. The gene 'A' has index 1, 'B' has index 2 and so on. For example, a 3, 2 stands for the risk of 'CB' fragment. Risk of disease occurence in the organism is equal to the sum of risks for each pair of adjacent genes in the genome. Scientists have already obtained a base organism. Some new organisms can be obtained by mutation of this organism. Mutation involves removal of all genes of some particular types. Such removal increases the total risk of disease occurence additionally. For each type of genes scientists determined t i — the increasement of the total risk of disease occurence provided by removal of all genes having type with index i . For example, t 4 stands for the value of additional total risk increasement in case of removing all the 'D' genes. Scientists want to find a number of different organisms that can be obtained from the given one which have the total risk of disease occurence not greater than T . They can use only the process of mutation described above. Two organisms are considered different if strings representing their genomes are different. Genome should contain at least one gene. The first line of the input contains three integer numbers N ( 1 ≤ N ≤ 200 000 ) — length of the genome of base organism, K ( 1 ≤ K ≤ 22 ) — the maximal index of gene type in the genome and T ( 1 ≤ T ≤ 2·10 9 ) — maximal allowable risk of disease occurence. The second line contains the genome of the given organism. It is a string of the first K capital English letters having length N . The third line contains K numbers |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
379997 |
tourist |
C |
April 12, 2011, 1:54 p.m. |
OK |
Delphi |
TESTS |
23 |
1030 |
92569600 |
|
2700 |
|
422540 |
maxim_polt |
C |
May 3, 2011, 1 a.m. |
OK |
Delphi |
TESTS |
23 |
1050 |
92569600 |
|
2700 |
|
1181872 |
zanoes |
C |
Feb. 15, 2012, 9:39 a.m. |
OK |
Delphi |
TESTS |
23 |
1140 |
18534400 |
|
2700 |
|
1810229 |
blackapple |
C |
June 19, 2012, 12:23 p.m. |
OK |
FPC |
TESTS |
23 |
630 |
35123200 |
|
2700 |
|
1505782 |
sillycross |
C |
April 9, 2012, 2:59 a.m. |
OK |
FPC |
TESTS |
23 |
1330 |
34918400 |
|
2700 |
|
41545941 |
vjudge2 |
C |
Aug. 13, 2018, 4:55 a.m. |
OK |
GNU C++ |
TESTS |
23 |
93 |
16896000 |
|
2700 |
|
41545869 |
Serval |
C |
Aug. 13, 2018, 4:49 a.m. |
OK |
GNU C++ |
TESTS |
23 |
108 |
16896000 |
|
2700 |
|
41544306 |
vjudge5 |
C |
Aug. 13, 2018, 2:59 a.m. |
OK |
GNU C++ |
TESTS |
23 |
109 |
33689600 |
|
2700 |
|
41639383 |
vjudge1 |
C |
Aug. 16, 2018, 3:48 a.m. |
OK |
GNU C++ |
TESTS |
23 |
124 |
16793600 |
|
2700 |
|
41614564 |
ITcarrot |
C |
Aug. 15, 2018, 8:18 a.m. |
OK |
GNU C++ |
TESTS |
23 |
124 |
16793600 |
|
2700 |
|
41611317 |
ITcarrot |
C |
Aug. 15, 2018, 6:35 a.m. |
OK |
GNU C++ |
TESTS |
23 |
124 |
16998400 |
|
2700 |
|
41639372 |
Void_Malzahar |
C |
Aug. 16, 2018, 3:48 a.m. |
OK |
GNU C++ |
TESTS |
23 |
139 |
16793600 |
|
2700 |
|
41621558 |
vjudge2 |
C |
Aug. 15, 2018, 12:14 p.m. |
OK |
GNU C++ |
TESTS |
23 |
139 |
16793600 |
|
2700 |
|
41623207 |
vjudge1 |
C |
Aug. 15, 2018, 12:59 p.m. |
OK |
GNU C++ |
TESTS |
23 |
140 |
16998400 |
|
2700 |
|
29870522 |
zaidaljundi |
C |
Aug. 29, 2017, 3:10 p.m. |
OK |
GNU C++ |
TESTS |
23 |
155 |
33689600 |
|
2700 |
|
3858634 |
watashi |
C |
June 11, 2013, 8:23 p.m. |
OK |
GNU C++0x |
TESTS |
23 |
359 |
51507200 |
|
2700 |
|
3858633 |
watashi |
C |
June 11, 2013, 8:23 p.m. |
OK |
GNU C++0x |
TESTS |
23 |
484 |
85094400 |
|
2700 |
|
62250164 |
shuashuawan |
C |
Oct. 10, 2019, 9:01 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
93 |
16998400 |
|
2700 |
|
55852615 |
luogu_bot4 |
C |
June 21, 2019, 5:03 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
93 |
134553600 |
|
2700 |
|
55676802 |
syksykCCC |
C |
June 17, 2019, 10:52 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
93 |
134656000 |
|
2700 |
|
63652491 |
CMZ |
C |
Oct. 28, 2019, 11:48 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
108 |
16998400 |
|
2700 |
|
64290447 |
gubeiqg |
C |
Nov. 5, 2019, 6:48 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
108 |
134656000 |
|
2700 |
|
46358837 |
luogu_bot1 |
C |
Nov. 29, 2018, 9:56 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
109 |
16793600 |
|
2700 |
|
63652528 |
vjudge2 |
C |
Oct. 28, 2019, 11:49 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
109 |
16998400 |
|
2700 |
|
63652295 |
CMZ |
C |
Oct. 28, 2019, 11:45 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
109 |
16998400 |
|
2700 |
|
63651241 |
CMZ |
C |
Oct. 28, 2019, 11:27 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
109 |
16998400 |
|
2700 |
|
55611484 |
syksykCCC |
C |
June 16, 2019, 6:03 a.m. |
OK |
GNU C++11 |
TESTS |
23 |
109 |
16998400 |
|
2700 |
|
56016719 |
sorry_im_smurfing |
C |
June 24, 2019, 9:54 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
155 |
33792000 |
|
2700 |
|
53791657 |
mobu233 |
C |
May 5, 2019, 1:11 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
156 |
33792000 |
|
2700 |
|
35533963 |
iqqsoszs |
C |
Feb. 20, 2018, 9:52 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
358 |
52838400 |
|
2700 |
|
39044779 |
vanogam |
C |
June 8, 2018, 11:44 a.m. |
OK |
GNU C++14 |
TESTS |
23 |
374 |
18534400 |
|
2700 |
|
37236344 |
Cmise |
C |
April 12, 2018, midnight |
OK |
GNU C++14 |
TESTS |
23 |
404 |
108544000 |
|
2700 |
|
44267792 |
Shayan.P |
C |
Oct. 13, 2018, 5:28 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
514 |
33792000 |
|
2700 |
|
21404401 |
ko_osaga |
C |
Oct. 13, 2016, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
23 |
514 |
68608000 |
|
2700 |
|
45378830 |
coconight |
C |
Nov. 6, 2018, 1:41 p.m. |
OK |
GNU C++17 |
TESTS |
23 |
93 |
17305600 |
|
2700 |
|
65026752 |
hjk1030 |
C |
Nov. 15, 2019, 8:03 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
124 |
16998400 |
|
2700 |
|
59595876 |
Alpha_2019 |
C |
Aug. 28, 2019, 1:37 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
140 |
17305600 |
|
2700 |
|
39233342 |
ruo |
C |
June 14, 2018, 6:44 a.m. |
OK |
GNU C++17 |
TESTS |
23 |
936 |
39116800 |
|
2700 |
|
381744 |
OgieKako |
C |
April 12, 2011, 6:24 p.m. |
OK |
Java 6 |
TESTS |
23 |
1560 |
154726400 |
|
2700 |
|
23349186 |
Chapecoense |
C |
Dec. 26, 2016, 10 p.m. |
OK |
Java 8 |
TESTS |
23 |
873 |
116121600 |
|
2700 |
|
381910 |
KADR |
C |
April 12, 2011, 8:32 p.m. |
OK |
MS C++ |
TESTS |
23 |
630 |
18432000 |
|
2700 |
|
18892921 |
Oleg_Smirnov |
C |
July 5, 2016, 4:42 a.m. |
OK |
MS C++ |
TESTS |
23 |
639 |
85094400 |
|
2700 |
|
388404 |
Medium |
C |
April 14, 2011, 11:38 p.m. |
OK |
MS C++ |
TESTS |
23 |
800 |
18636800 |
|
2700 |
|
423051 |
fjxingyue |
C |
May 3, 2011, 2:09 p.m. |
OK |
MS C++ |
TESTS |
23 |
1550 |
35225600 |
|
2700 |
|
381864 |
Coder |
C |
April 12, 2011, 8:01 p.m. |
OK |
MS C++ |
TESTS |
23 |
1950 |
24985600 |
|
2700 |
|
1687371 |
Astekinane |
C |
May 14, 2012, 9:59 a.m. |
OK |
MS C++ |
TESTS |
23 |
1970 |
24985600 |
|
2700 |
remove filters
Back to search problems