Codeforces Round 780 (Div. 3)

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
1660 Codeforces Round 780 (Div. 3) FINISHED False 8100 88529063 March 31, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2806 ) F2 Promising String (hard version) PROGRAMMING data structures implementation math strings

B'This is the hard version of Problem F. The only difference between the easy version and the hard version is the constraints. We will call a non-empty string balanced if it contains the same number of plus and minus signs. For example: strings "+--+" and "++-+--" are balanced, and strings "+--", "--" and "" are not balanced. We will call a string promising if the string can be made balanced by several (possibly zero) uses of the following operation: In particular, every balanced string is promising. However, the converse is not true: not every promising string is balanced. For example, the string "-+---" is promising, because you can replace two adjacent minuses with plus and get a balanced string "-++-", or get another balanced string "-+-+". How many non-empty substrings of the given string s are promising? Each non-empty promising substring must be counted in the answer as many times as it occurs in string s . Recall that a substring is a sequence of consecutive characters of the string. For example, for string "+-+" its substring are: "+-", "-+", "+", "+-+" (the string is a substring of itself) and some others. But the following strings are not its substring: "--", "++", "-++". The first line of the input contains an integer t ( 1 <= t <= 10^4 ) --the number of test cases in the test. Then the descriptions of test cases follow. Each test case of input data consists of two lines. The first line consists of the number n ( 1 <= n <= 2 cdot 10^5 ): the length of s . The second line of the test case contains the string s of length n , consisting only of characters "+" and "-". It is guaranteed that the sum of values n over all test cases does not exceed 2 cdot 10^5 . For each test case, print a single number: the number of the promising non-empty substrings of string s . Each non-empty promising substring must be counted in the answer as many times as it occurs in string s . The foll'...

Tutorials

Codeforces Round #780 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
151630333 wumeibanfa F2 April 1, 2022, 5:46 a.m. OK GNU C++14 TESTS 59 15 6963200
151589538 meyi F2 March 31, 2022, 4:52 p.m. OK GNU C++14 TESTS 59 31 5017600
151590053 awoo F2 March 31, 2022, 4:54 p.m. OK GNU C++14 TESTS 59 31 5222400
151621297 duoluoluo F2 April 1, 2022, 3:12 a.m. OK GNU C++14 TESTS 59 31 5836800
151614652 kaiming_xxy F2 March 31, 2022, 11:50 p.m. OK GNU C++14 TESTS 59 31 5836800
151602516 illume2021 F2 March 31, 2022, 7:02 p.m. OK GNU C++14 TESTS 59 31 6144000
151620596 Aegirs F2 April 1, 2022, 2:54 a.m. OK GNU C++14 TESTS 59 31 6553600
151620508 Aegirs F2 April 1, 2022, 2:52 a.m. OK GNU C++14 TESTS 59 31 6553600
151620336 Aegirs F2 April 1, 2022, 2:47 a.m. OK GNU C++14 TESTS 59 31 6553600
151592681 little_aurora F2 March 31, 2022, 5:13 p.m. OK GNU C++14 TESTS 59 31 6963200
151590205 Awcotn1 F2 March 31, 2022, 4:55 p.m. OK GNU C++17 TESTS 59 15 5017600
151620698 yanx F2 April 1, 2022, 2:57 a.m. OK GNU C++17 TESTS 59 15 9830400
151630104 Puck00 F2 April 1, 2022, 5:43 a.m. OK GNU C++17 TESTS 59 30 2969600
151629573 Puck214 F2 April 1, 2022, 5:36 a.m. OK GNU C++17 TESTS 59 30 2969600
151595784 panyaoyu1999 F2 March 31, 2022, 5:42 p.m. OK GNU C++17 TESTS 59 30 3379200
151622160 KoToBa F2 April 1, 2022, 3:31 a.m. OK GNU C++17 TESTS 59 30 5836800
151589658 savvadimailya F2 March 31, 2022, 4:52 p.m. OK GNU C++17 TESTS 59 30 26214400
151618692 _super_panty F2 April 1, 2022, 2:08 a.m. OK GNU C++17 TESTS 59 31 3379200
151592300 hibye1217 F2 March 31, 2022, 5:10 p.m. OK GNU C++17 TESTS 59 31 3481600
151596489 pseong F2 March 31, 2022, 5:50 p.m. OK GNU C++17 TESTS 59 31 3788800
151584259 Hi_rvn F2 March 31, 2022, 4:39 p.m. OK GNU C++17 (64) TESTS 59 15 12595200
151584511 suta F2 March 31, 2022, 4:39 p.m. OK GNU C++17 (64) TESTS 59 30 6963200
151617196 bandiaoz F2 April 1, 2022, 1:25 a.m. OK GNU C++17 (64) TESTS 59 30 7782400
151618182 moo. F2 April 1, 2022, 1:54 a.m. OK GNU C++17 (64) TESTS 59 30 10137600
151624387 asd12 F2 April 1, 2022, 4:17 a.m. OK GNU C++17 (64) TESTS 59 30 13312000
151621814 Eter.nal F2 April 1, 2022, 3:23 a.m. OK GNU C++17 (64) TESTS 59 30 14643200
151594839 Gice F2 March 31, 2022, 5:32 p.m. OK GNU C++17 (64) TESTS 59 31 3379200
151597748 Owmicron F2 March 31, 2022, 6:05 p.m. OK GNU C++17 (64) TESTS 59 31 5017600
151629261 Sion_y F2 April 1, 2022, 5:32 a.m. OK GNU C++17 (64) TESTS 59 31 6348800
151591612 RealKing F2 March 31, 2022, 5:05 p.m. OK GNU C++17 (64) TESTS 59 31 6656000
151619411 __declspec F2 April 1, 2022, 2:27 a.m. OK GNU C++20 (64) TESTS 59 15 3686400
151617969 violet_apricity F2 April 1, 2022, 1:48 a.m. OK GNU C++20 (64) TESTS 59 15 5324800
151618100 yizhiyezi F2 April 1, 2022, 1:51 a.m. OK GNU C++20 (64) TESTS 59 15 6963200
151583678 maghrabyJr_ F2 March 31, 2022, 4:37 p.m. OK GNU C++20 (64) TESTS 59 15 7782400
151595971 keta_tsimakuridze F2 March 31, 2022, 5:45 p.m. OK GNU C++20 (64) TESTS 59 15 10137600
151592983 Meul F2 March 31, 2022, 5:15 p.m. OK GNU C++20 (64) TESTS 59 30 6963200
151609991 cosenza F2 March 31, 2022, 9:06 p.m. OK GNU C++20 (64) TESTS 59 31 2969600
151626699 _vjudge8 F2 April 1, 2022, 4:54 a.m. OK GNU C++20 (64) TESTS 59 31 4915200
151618588 Bananana. F2 April 1, 2022, 2:06 a.m. OK GNU C++20 (64) TESTS 59 31 5017600
151592638 200815147 F2 March 31, 2022, 5:12 p.m. OK GNU C++20 (64) TESTS 59 31 5222400
151614264 Relief F2 March 31, 2022, 11:33 p.m. OK Java 11 TESTS 59 187 0
151630943 soumit915 F2 April 1, 2022, 5:54 a.m. OK Java 11 TESTS 59 233 13107200
151590698 Dukkha F2 March 31, 2022, 4:58 p.m. OK Java 11 TESTS 59 265 0
151603114 Longgggggggg F2 March 31, 2022, 7:10 p.m. OK Java 11 TESTS 59 296 19148800
151622792 hanel1164 F2 April 1, 2022, 3:44 a.m. OK Kotlin 1.4 TESTS 59 109 0
151615060 xuhao95 F2 April 1, 2022, 12:07 a.m. OK PyPy 3 TESTS 59 421 9728000
151597203 zouyu9631 F2 March 31, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 59 311 17715200
151628495 siganai F2 April 1, 2022, 5:21 a.m. OK PyPy 3-64 TESTS 59 358 35123200
151610803 Het_Fadia F2 March 31, 2022, 9:27 p.m. OK PyPy 3-64 TESTS 59 405 77824000
151610701 Het_Fadia F2 March 31, 2022, 9:24 p.m. OK PyPy 3-64 TESTS 59 405 79564800
151610648 Het_Fadia F2 March 31, 2022, 9:23 p.m. OK PyPy 3-64 TESTS 59 405 79564800
151610559 Het_Fadia F2 March 31, 2022, 9:21 p.m. OK PyPy 3-64 TESTS 59 405 85811200
151610750 Het_Fadia F2 March 31, 2022, 9:25 p.m. OK PyPy 3-64 TESTS 59 420 79564800
151599169 notTehlka F2 March 31, 2022, 6:20 p.m. OK PyPy 3-64 TESTS 59 561 13107200
151616754 wwwwzhh F2 April 1, 2022, 1:08 a.m. OK PyPy 3-64 TESTS 59 608 36352000
151629332 Neothehero F2 April 1, 2022, 5:33 a.m. OK PyPy 3-64 TESTS 59 920 37478400
151627187 Spheniscine F2 April 1, 2022, 5:01 a.m. OK Rust 2021 TESTS 59 15 5120000

remove filters

Back to search problems