Codeforces Round 294 (Div. 2)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
519 Codeforces Round 294 (Div. 2) FINISHED False 7200 312310787 Feb. 28, 2015, 1 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6428 ) D A and B and Interesting Substrings PROGRAMMING data structures dp two pointers 1900

B'A and B are preparing themselves for programming contests. After several years of doing sports programming and solving many problems that require calculating all sorts of abstract objects, A and B also developed rather peculiar tastes. A likes lowercase letters of the Latin alphabet. He has assigned to each letter a number that shows how much he likes that letter (he has assigned negative numbers to the letters he dislikes). B likes substrings. He especially likes the ones that start and end with the same letter (their length must exceed one). Also, A and B have a string s. Now they are trying to find out how many substrings t of a string s are interesting to B (that is, t starts and ends with the same letter and its length is larger than one), and also the sum of values of all letters (assigned by A), except for the first and the last one is equal to zero. Naturally, A and B have quickly found the number of substrings t that are interesting to them. Can you do it? The first line contains 26 integers xa, xe2 x80 x89xb, xe2 x80 x89..., xe2 x80 x89xz ( xe2 x80 x89- xe2 x80 x89105 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the value assigned to letters a, xe2 x80 x89b, xe2 x80 x89c, xe2 x80 x89..., xe2 x80 x89z respectively. The second line contains string s of length between 1 and 105 characters, consisting of Lating lowercase letters -- the string for which you need to calculate the answer. Print the answer to the problem. In the first sample test strings satisfying the condition above are abca and bcab. In the second sample test strings satisfying the condition above are two occurences of aa.'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41270355 cpy D Aug. 6, 2018, 9:50 a.m. OK D TESTS 47 46 11776000 1900
31891759 treeofapple D Oct. 30, 2017, 11:34 a.m. OK GNU C++ TESTS 47 46 4915200 1900
34544130 vjudge1 D Jan. 25, 2018, 11:28 a.m. OK GNU C++ TESTS 47 46 6144000 1900
34543052 vjudge5 D Jan. 25, 2018, 10:36 a.m. OK GNU C++ TESTS 47 46 6144000 1900
30898180 hephaestus D Oct. 1, 2017, 4:33 a.m. OK GNU C++ TESTS 47 46 6144000 1900
34255614 vjudge5 D Jan. 17, 2018, 3:23 p.m. OK GNU C++ TESTS 47 46 6758400 1900
25537325 vjudge5 D March 16, 2017, 3:05 a.m. OK GNU C++ TESTS 47 46 7065600 1900
24795973 vjudge5 D Feb. 19, 2017, 6:41 a.m. OK GNU C++ TESTS 47 46 7065600 1900
24794312 vjudge5 D Feb. 19, 2017, 4:36 a.m. OK GNU C++ TESTS 47 46 7065600 1900
33853281 bitman_123 D Jan. 1, 2018, 6:44 p.m. OK GNU C++ TESTS 47 46 7577600 1900
33951719 vjudge1 D Jan. 5, 2018, 9:34 p.m. OK GNU C++ TESTS 47 46 8089600 1900
57408343 rainboy D July 20, 2019, 4:52 p.m. OK GNU C11 TESTS 47 109 4915200 1900
40986961 ReaLNero1 D July 30, 2018, 8:52 p.m. OK GNU C++11 TESTS 47 31 2560000 1900
53475133 NoNameTemp-ly D April 28, 2019, 3 p.m. OK GNU C++11 TESTS 47 46 4096000 1900
48097352 s1dor D Jan. 8, 2019, 5:45 p.m. OK GNU C++11 TESTS 47 46 4096000 1900
69151377 minyzero D Jan. 19, 2020, 5:45 p.m. OK GNU C++11 TESTS 47 46 4096000 1900
43553325 vjudge3 D Sept. 29, 2018, 3:37 a.m. OK GNU C++11 TESTS 47 46 4198400 1900
31262011 Lius D Oct. 12, 2017, 11:09 p.m. OK GNU C++11 TESTS 47 46 4198400 1900
30763991 eriksuenderhauf D Sept. 26, 2017, 9:56 p.m. OK GNU C++11 TESTS 47 46 4812800 1900
65243739 code_cola D Nov. 17, 2019, 9:34 a.m. OK GNU C++11 TESTS 47 46 4915200 1900
42798547 vjudge3 D Sept. 12, 2018, 1:03 p.m. OK GNU C++11 TESTS 47 46 5222400 1900
66670938 _jthe D Dec. 12, 2019, 9:17 a.m. OK GNU C++11 TESTS 47 46 5529600 1900
31875859 Zxyelf D Oct. 29, 2017, 7:31 p.m. OK GNU C++14 TESTS 47 31 5836800 1900
27468326 MesutOzill11 D May 31, 2017, 1:54 p.m. OK GNU C++14 TESTS 47 31 6144000 1900
25542511 greedy_me D March 16, 2017, 8:37 a.m. OK GNU C++14 TESTS 47 31 8294400 1900
58461102 vjudge2 D Aug. 8, 2019, 4:33 p.m. OK GNU C++14 TESTS 47 46 4300800 1900
53819032 Black.n.White D May 6, 2019, 12:11 p.m. OK GNU C++14 TESTS 47 46 4300800 1900
52260973 mini4141 D April 3, 2019, 8:47 a.m. OK GNU C++14 TESTS 47 46 4300800 1900
51842988 coldEr66 D March 26, 2019, 12:50 a.m. OK GNU C++14 TESTS 47 46 4300800 1900
49138723 rdd6584 D Jan. 29, 2019, 9:04 a.m. OK GNU C++14 TESTS 47 46 4300800 1900
30536845 3015218054 D Sept. 20, 2017, 6:59 a.m. OK GNU C++14 TESTS 47 46 4300800 1900
61553636 kgcurry59 D Sept. 30, 2019, 1:20 p.m. OK GNU C++14 TESTS 47 46 4300800 1900
55102859 Rahul D June 4, 2019, 9:56 p.m. OK GNU C++17 TESTS 47 46 4300800 1900
51264184 abhishek_20123 D March 13, 2019, 2:44 p.m. OK GNU C++17 TESTS 47 46 4300800 1900
64715641 chauhan176 D Nov. 11, 2019, 9:44 p.m. OK GNU C++17 TESTS 47 46 4300800 1900
44991625 saurabh18213 D Oct. 28, 2018, 1:11 p.m. OK GNU C++17 TESTS 47 46 4505600 1900
50149764 vjudge5 D Feb. 19, 2019, 6:47 a.m. OK GNU C++17 TESTS 47 46 4915200 1900
63876722 JonathanR D Oct. 30, 2019, 7:14 p.m. OK GNU C++17 TESTS 47 46 5017600 1900
63255261 r19 D Oct. 23, 2019, 5:56 p.m. OK GNU C++17 TESTS 47 46 5120000 1900
59856785 vjudge5 D Sept. 1, 2019, 1:51 p.m. OK GNU C++17 TESTS 47 46 5120000 1900
59082618 codeict D Aug. 19, 2019, 9:47 a.m. OK GNU C++17 TESTS 47 46 5120000 1900
63283033 ruo D Oct. 24, 2019, 9:21 a.m. OK GNU C++17 TESTS 47 46 5120000 1900
63280359 120405217 D Oct. 24, 2019, 8:28 a.m. OK Go TESTS 47 62 4608000 1900
63130754 120405217 D Oct. 22, 2019, 2:07 p.m. OK Go TESTS 47 62 4608000 1900
29946829 coderbond007 D Aug. 31, 2017, 2:21 p.m. OK Java 8 TESTS 47 124 0 1900
59110539 AbdallahArafa D Aug. 19, 2019, 8:21 p.m. OK Java 8 TESTS 47 140 0 1900
53901968 jenish9599 D May 9, 2019, 10:48 a.m. OK Java 8 TESTS 47 140 0 1900
47722412 DATVN D Dec. 30, 2018, 12:10 p.m. OK Java 8 TESTS 47 140 3481600 1900
24601014 VerticesEdge D Feb. 12, 2017, 4:41 a.m. OK Java 8 TESTS 47 140 20377600 1900
68707107 sunnycarlos D Jan. 13, 2020, 11:43 a.m. OK Java 8 TESTS 47 155 0 1900
56055717 samer_ghaly D June 25, 2019, 11:14 p.m. OK Java 8 TESTS 47 155 0 1900
56048129 TheSawan D June 25, 2019, 5:37 p.m. OK Java 8 TESTS 47 155 0 1900
59110411 Hemose D Aug. 19, 2019, 8:16 p.m. OK Java 8 TESTS 47 155 3072000 1900
26140450 U_Square D April 5, 2017, 10:40 a.m. OK Java 8 TESTS 47 155 20582400 1900
34545528 vjudge1 D Jan. 25, 2018, 12:23 p.m. OK MS C++ TESTS 47 46 7782400 1900
26336291 Tearzm D April 13, 2017, 12:04 p.m. OK MS C++ TESTS 47 46 8499200 1900
34545341 vjudge2 D Jan. 25, 2018, 12:16 p.m. OK MS C++ TESTS 47 61 7782400 1900
50150902 vjudge3 D Feb. 19, 2019, 7:21 a.m. OK MS C++ TESTS 47 61 9830400 1900
50152805 vjudge2 D Feb. 19, 2019, 8:21 a.m. OK MS C++ TESTS 47 62 5734400 1900
69226153 vjudge1 D Jan. 21, 2020, 7:19 a.m. OK MS C++ TESTS 47 62 6656000 1900
68606847 vjudge2 D Jan. 11, 2020, 2:25 p.m. OK MS C++ TESTS 47 62 6860800 1900
50604916 vjudge4 D Feb. 28, 2019, 2:09 p.m. OK MS C++ TESTS 47 62 9830400 1900
37634625 Ivan_Bondarev D April 26, 2018, 12:03 p.m. OK MS C++ TESTS 47 62 10342400 1900
50150202 vjudge1 D Feb. 19, 2019, 7 a.m. OK MS C++ TESTS 47 62 10547200 1900
68608071 vjudge1 D Jan. 11, 2020, 2:43 p.m. OK MS C++ 2017 TESTS 47 46 5632000 1900
51255793 CtrlAlt D March 13, 2019, 11:14 a.m. OK MS C++ 2017 TESTS 47 61 5017600 1900
69226105 djl_SCUT D Jan. 21, 2020, 7:18 a.m. OK MS C++ 2017 TESTS 47 62 5939200 1900
69095185 vjudge1 D Jan. 19, 2020, 11:46 a.m. OK MS C++ 2017 TESTS 47 62 19456000 1900
59108816 yorky D Aug. 19, 2019, 7:19 p.m. OK MS C++ 2017 TESTS 47 77 9011200 1900
42258759 Onesh0t D Aug. 30, 2018, 12:50 a.m. OK PyPy 2 TESTS 47 202 13721600 1900
62533845 PS41 D Oct. 13, 2019, 8:51 p.m. OK PyPy 3 TESTS 47 202 16179200 1900
56785393 Doctor-Venom D July 10, 2019, 8:09 a.m. OK PyPy 3 TESTS 47 218 15974400 1900
68406368 Firepaw D Jan. 8, 2020, 3:05 p.m. OK PyPy 3 TESTS 47 623 23756800 1900
68313996 UTMoonlight D Jan. 6, 2020, 12:29 p.m. OK PyPy 3 TESTS 47 779 164249600 1900
32534457 vedkumar_patel D Nov. 21, 2017, 7:35 p.m. OK Python 2 TESTS 47 156 9113600 1900
29344790 simplecode D Aug. 11, 2017, 6:24 a.m. OK Python 2 TESTS 47 187 14028800 1900
42111036 romil797 D Aug. 26, 2018, 6:02 a.m. OK Python 2 TESTS 47 265 18022400 1900
68976821 vegetablesandwich D Jan. 17, 2020, 9:08 a.m. OK Python 3 TESTS 47 218 7680000 1900
45335681 MightyLazyBones D Nov. 5, 2018, 5:31 p.m. OK Python 3 TESTS 47 280 7577600 1900
35864987 Gleb_Dubosarskii D March 2, 2018, 11:54 p.m. OK Python 3 TESTS 47 327 13824000 1900
49818935 codeminion D Feb. 12, 2019, 7:41 a.m. OK Python 3 TESTS 47 343 8908800 1900
43648081 spellstaker D Oct. 1, 2018, 2:32 p.m. OK Python 3 TESTS 47 451 8396800 1900
35885121 ______u______ D March 3, 2018, 1:22 p.m. OK Ruby TESTS 47 343 24780800 1900
35885004 ______n______ D March 3, 2018, 1:21 p.m. OK Ruby TESTS 47 343 24780800 1900
35884197 _____k_____ D March 3, 2018, 1:08 p.m. OK Ruby TESTS 47 343 24780800 1900
35883914 _____i_____ D March 3, 2018, 1:03 p.m. OK Ruby TESTS 47 343 24780800 1900
35873348 ______h______ D March 3, 2018, 7:29 a.m. OK Ruby TESTS 47 343 24780800 1900
35873156 ______k______ D March 3, 2018, 7:24 a.m. OK Ruby TESTS 47 343 24780800 1900
35872674 ______i______ D March 3, 2018, 7:16 a.m. OK Ruby TESTS 47 343 24780800 1900
35870739 ______M______ D March 3, 2018, 6:34 a.m. OK Ruby TESTS 47 343 24780800 1900

remove filters

Back to search problems