Codeforces Round 934 (Div. 1)

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
1943 Codeforces Round 934 (Div. 1) FINISHED False 8700 26580263 March 16, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3984 ) B Non-Palindromic Substring PROGRAMMING data structures hashing implementation math strings

B'A string t is said to be k -good if there exists at least one substring ^ dagger of length k which is not a palindrome ^ ddagger . Let f(t) denote the sum of all values of k such that the string t is k -good. You are given a string s of length n . You will have to answer q of the following queries: ^ dagger A substring of a string z is a contiguous segment of characters from z . For example, " mathtt{defor} ", " mathtt{code} " and " mathtt{o} " are all substrings of " mathtt{codeforces} " while " mathtt{codes} " and " mathtt{aaa} " are not. ^ ddagger A palindrome is a string that reads the same backwards as forwards. For example, the strings " texttt{z} ", " texttt{aa} " and " texttt{tacocat} " are palindromes while " texttt{codeforces} " and " texttt{ab} " are not. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and q ( 2 <= n <= 2 cdot 10^5, 1 <= q <= 2 cdot 10^5 ), the size of the string and the number of queries respectively. The second line of each test case contains the string s . It is guaranteed the string s only contains lowercase English characters. The next q lines each contain two integers, l and r ( 1 <= l < r <= n ). It is guaranteed the sum of n and the sum of q both do not exceed 2 cdot 10^5 . For each query, output f(s_ls_{l + 1} ldots s_r) . In the first query of the first test case, the string is mathtt{aaab} . mathtt{aaab} , mathtt{aab} and mathtt{ab} are all substrings that are not palindromes, and they have lengths 4 , 3 and 2 respectively. Thus, the string is 2 -'...

Tutorials

Codeforces Round #934 (Div1, Div2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
251741375 mban259 B March 16, 2024, 3:22 p.m. OK C# 10 TESTS 50 373 59289600
251839807 ImmortaLimit B March 17, 2024, 12:08 a.m. OK C++14 (GCC 6-32) TESTS 57 124 38809600
251745025 ACOIer B March 16, 2024, 3:27 p.m. OK C++14 (GCC 6-32) TESTS 50 171 5632000
251745544 Mapakaka B March 16, 2024, 3:28 p.m. OK C++14 (GCC 6-32) TESTS 50 171 37683200
251780951 0wuming0 B March 16, 2024, 4:31 p.m. OK C++14 (GCC 6-32) TESTS 50 187 4915200
251747948 ZifanWang B March 16, 2024, 3:31 p.m. OK C++14 (GCC 6-32) TESTS 50 187 11468800
251734436 Kilani B March 16, 2024, 3:13 p.m. OK C++14 (GCC 6-32) TESTS 50 202 6451200
251740483 using233 B March 16, 2024, 3:21 p.m. OK C++14 (GCC 6-32) TESTS 50 202 8806400
251750449 syx2567 B March 16, 2024, 3:35 p.m. OK C++14 (GCC 6-32) TESTS 50 202 12083200
251733447 Timsei B March 16, 2024, 3:12 p.m. OK C++14 (GCC 6-32) TESTS 50 202 26112000
251748653 keko37 B March 16, 2024, 3:32 p.m. OK C++14 (GCC 6-32) TESTS 50 217 3788800
251738756 Legitimity B March 16, 2024, 3:18 p.m. OK C++17 (GCC 7-32) TESTS 50 109 19558400
251737756 NTT B March 16, 2024, 3:17 p.m. OK C++17 (GCC 7-32) TESTS 50 124 5017600
251716417 cmk666 B March 16, 2024, 2:51 p.m. OK C++17 (GCC 7-32) TESTS 50 155 7372800
251721798 Little_Xi B March 16, 2024, 2:58 p.m. OK C++17 (GCC 7-32) TESTS 50 170 6963200
251747169 applese B March 16, 2024, 3:30 p.m. OK C++17 (GCC 7-32) TESTS 50 171 2969600
251716650 Flamire B March 16, 2024, 2:51 p.m. OK C++17 (GCC 7-32) TESTS 50 171 2969600
251740789 Ant_Man B March 16, 2024, 3:21 p.m. OK C++17 (GCC 7-32) TESTS 50 171 3584000
251728742 Hell2Evator B March 16, 2024, 3:06 p.m. OK C++17 (GCC 7-32) TESTS 50 171 3686400
251732280 dlalswp25 B March 16, 2024, 3:10 p.m. OK C++17 (GCC 7-32) TESTS 50 171 3891200
251735443 qwerasdfzxcl B March 16, 2024, 3:14 p.m. OK C++17 (GCC 7-32) TESTS 50 171 5222400
251740193 Gassa B March 16, 2024, 3:20 p.m. OK D TESTS 50 405 24268800
251779871 saptarshi1729 B March 16, 2024, 4:28 p.m. OK Java 21 TESTS 50 576 22528000
251737297 profchi B March 16, 2024, 3:17 p.m. OK Java 21 TESTS 50 1029 130867200
251780512 danbanica B March 16, 2024, 4:30 p.m. OK Java 21 TESTS 50 1482 151244800
251739302 yvbf B March 16, 2024, 3:19 p.m. OK Java 8 TESTS 50 280 0
251768610 iakovlev.zakhar B March 16, 2024, 4:05 p.m. OK Java 8 TESTS 50 311 0
251747505 SecondThread B March 16, 2024, 3:30 p.m. OK Java 8 TESTS 50 561 136192000
251714387 arvindf232 B March 16, 2024, 2:49 p.m. OK Kotlin 1.9 TESTS 50 358 2969600
251783164 wangchaohui B March 16, 2024, 4:36 p.m. OK Kotlin 1.9 TESTS 50 499 56832000
251789364 Shirotsume B March 16, 2024, 4:51 p.m. OK PyPy 3 TESTS 50 2948 68096000
251735208 misorin B March 16, 2024, 3:14 p.m. OK PyPy 3-64 TESTS 50 265 41369600
251716207 conqueror_of_tourist B March 16, 2024, 2:51 p.m. OK PyPy 3-64 TESTS 50 358 36044800
251735318 dabbler1 B March 16, 2024, 3:14 p.m. OK PyPy 3-64 TESTS 50 436 19046400
251801940 titia B March 16, 2024, 6:32 p.m. OK PyPy 3-64 TESTS 50 499 39424000
251758323 eepsilon B March 16, 2024, 3:47 p.m. OK PyPy 3-64 TESTS 50 546 49254400
251732440 chinerist B March 16, 2024, 3:10 p.m. OK PyPy 3-64 TESTS 50 576 47001600
251769435 Mukundan314 B March 16, 2024, 4:07 p.m. OK PyPy 3-64 TESTS 50 873 44441600
251781223 Maruzensky B March 16, 2024, 4:31 p.m. OK PyPy 3-64 TESTS 50 1106 40960000
251728491 toam B March 16, 2024, 3:06 p.m. OK PyPy 3-64 TESTS 50 1263 39014400
251753014 plevande B March 16, 2024, 3:39 p.m. OK PyPy 3-64 TESTS 50 1419 57241600
251791335 sansen B March 16, 2024, 4:56 p.m. OK Rust 2021 TESTS 50 124 21708800
251752206 toomer B March 16, 2024, 3:37 p.m. OK Rust 2021 TESTS 50 171 23347200
251758901 brown_amaurotis B March 16, 2024, 3:48 p.m. OK Rust 2021 TESTS 50 1731 16179200
251731730 Egor B March 16, 2024, 3:10 p.m. OK Rust 2021 TESTS 50 1747 10137600
251764078 ngtkana B March 16, 2024, 3:57 p.m. OK Rust 2021 TESTS 50 1808 13721600

remove filters

Back to search problems