Codeforces Round 873 (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
1827 Codeforces Round 873 (Div. 1) FINISHED False 7200 53191463 May 14, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1270 ) C Palindrome Partition PROGRAMMING binary search brute force data structures dp hashing strings 2600

B'A substring is a continuous and non-empty segment of letters from a given string, without any reorders. An even palindrome is a string that reads the same backward as forward and has an even length. For example, strings "zz", "abba", "abccba" are even palindromes, but strings "codeforces", "reality", "aba", "c" are not. A beautiful string is an even palindrome or a string that can be partitioned into some smaller even palindromes. You are given a string s , consisting of n lowercase Latin letters. Count the number of beautiful substrings of s . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 5 cdot 10^5 ). The second line of each test case contains a string s . String s consists of only lowercase Latin letters and has a length of n . It is guaranteed that the sum of n over all test cases does not exceed 5 cdot 10^5 . For each test case print the number of beautiful substrings. In the first test case, the beautiful substrings are "abaaba", "baab", "aa". In the last test case, the beautiful substrings are "aa" (counted twice), "abba", "bb", "bbaa", "abbaaa". '...

Tutorials

Codeforces Round #873 (Div. 1 & 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
205922654 rainboy C May 14, 2023, 8:52 p.m. OK GNU C11 TESTS 50 62 11571200 2600
205885398 _Guoyh_ C May 14, 2023, 3:41 p.m. OK GNU C++14 TESTS 50 31 9728000 2600
206050867 c1120231020 C May 16, 2023, 5:54 a.m. OK GNU C++14 TESTS 51 31 10649600 2600
206182062 peiwenjun C May 17, 2023, 7:49 a.m. OK GNU C++14 TESTS 51 31 17305600 2600
206003899 xukai C May 15, 2023, 3:40 p.m. OK GNU C++14 TESTS 50 31 22016000 2600
206345736 xiaowangba C May 18, 2023, 1:30 p.m. OK GNU C++14 TESTS 51 31 22016000 2600
205898497 HailHomura C May 14, 2023, 4:25 p.m. OK GNU C++14 TESTS 50 31 25088000 2600
206138017 rfpermen C May 16, 2023, 5:16 p.m. OK GNU C++14 TESTS 51 31 25088000 2600
206040006 Starch C May 16, 2023, 2:31 a.m. OK GNU C++14 TESTS 51 31 60620800 2600
206040019 qwq_bot C May 16, 2023, 2:31 a.m. OK GNU C++14 TESTS 51 31 60620800 2600
206056128 tokitsukaze C May 16, 2023, 7:05 a.m. OK GNU C++14 TESTS 51 31 68710400 2600
206253616 _xqy_ C May 17, 2023, 5:02 p.m. OK GNU C++17 TESTS 51 31 7372800 2600
206305644 2100030662.cseh C May 18, 2023, 6:51 a.m. OK GNU C++17 TESTS 51 31 8192000 2600
206017859 sridharsiddi C May 15, 2023, 6:07 p.m. OK GNU C++17 TESTS 50 31 8192000 2600
205965035 Kilarapu_Pavani C May 15, 2023, 9:54 a.m. OK GNU C++17 TESTS 50 31 8192000 2600
205959605 Karthik1106 C May 15, 2023, 8:56 a.m. OK GNU C++17 TESTS 50 31 8192000 2600
206370118 prafull_08 C May 18, 2023, 5:22 p.m. OK GNU C++17 TESTS 51 31 8192000 2600
205915077 maqi_maqi C May 14, 2023, 7:09 p.m. OK GNU C++17 TESTS 50 31 10444800 2600
205901086 sinus_070 C May 14, 2023, 4:33 p.m. OK GNU C++17 TESTS 50 31 14540800 2600
205898823 Ant_Man C May 14, 2023, 4:26 p.m. OK GNU C++17 TESTS 50 31 60620800 2600
206044572 N.E.R.O C May 16, 2023, 4:13 a.m. OK GNU C++17 TESTS 51 31 125952000 2600
205992143 Olerinskiy C May 15, 2023, 1:48 p.m. OK GNU C++17 (64) TESTS 50 31 10752000 2600
205897300 q-w-q-w-q C May 14, 2023, 4:20 p.m. OK GNU C++17 (64) TESTS 50 31 11059200 2600
205892597 SegmentMaster C May 14, 2023, 4:04 p.m. OK GNU C++17 (64) TESTS 50 31 18124800 2600
205930853 Alex_Wei C May 15, 2023, 12:50 a.m. OK GNU C++17 (64) TESTS 50 31 22323200 2600
205890064 BeyondHeaven C May 14, 2023, 3:55 p.m. OK GNU C++17 (64) TESTS 50 31 129228800 2600
205947570 orzdevinwang C May 15, 2023, 6:27 a.m. OK GNU C++17 (64) TESTS 50 31 133222400 2600
205890483 4ever_in_queue C May 14, 2023, 3:56 p.m. OK GNU C++17 (64) TESTS 50 46 7475200 2600
205910644 YeongTree C May 14, 2023, 6:29 p.m. OK GNU C++17 (64) TESTS 50 46 12800000 2600
206041491 Z-301 C May 16, 2023, 3:05 a.m. OK GNU C++17 (64) TESTS 51 46 45158400 2600
205884196 Sana C May 14, 2023, 3:38 p.m. OK GNU C++17 (64) TESTS 50 46 65740800 2600
205927328 jeroenodb C May 14, 2023, 10:39 p.m. OK GNU C++20 (64) TESTS 50 30 9216000 2600
205925043 jeroenodb C May 14, 2023, 9:41 p.m. OK GNU C++20 (64) TESTS 50 31 6860800 2600
205882775 peltorator C May 14, 2023, 3:34 p.m. OK GNU C++20 (64) TESTS 50 31 9113600 2600
205953138 faoo C May 15, 2023, 7:39 a.m. OK GNU C++20 (64) TESTS 50 31 9113600 2600
205964965 conglingkaishi C May 15, 2023, 9:54 a.m. OK GNU C++20 (64) TESTS 50 31 9216000 2600
205939920 neerajam C May 15, 2023, 4:24 a.m. OK GNU C++20 (64) TESTS 50 31 9216000 2600
205927414 jeroenodb C May 14, 2023, 10:42 p.m. OK GNU C++20 (64) TESTS 50 31 9216000 2600
205927403 jeroenodb C May 14, 2023, 10:41 p.m. OK GNU C++20 (64) TESTS 50 31 9216000 2600
206010141 srinija_chowdary9 C May 15, 2023, 4:44 p.m. OK GNU C++20 (64) TESTS 50 31 9216000 2600
206031697 czhang2718 C May 15, 2023, 9:47 p.m. OK GNU C++20 (64) TESTS 50 31 9728000 2600
205941641 0x3F C May 15, 2023, 4:55 a.m. OK Go TESTS 50 46 25497600 2600
205941884 0x3F C May 15, 2023, 4:58 a.m. OK Go TESTS 50 62 25497600 2600
205904589 SecondThread C May 14, 2023, 5:19 p.m. OK Java 8 TESTS 50 280 154624000 2600
205890482 FastFreeTask C May 14, 2023, 3:56 p.m. OK Kotlin 1.6 TESTS 50 639 43724800 2600
205883206 Jimanbanashi C May 14, 2023, 3:35 p.m. OK PyPy 2 TESTS 50 358 29696000 2600
205895161 huangxw C May 14, 2023, 4:13 p.m. OK PyPy 3-64 TESTS 50 467 86220800 2600
205881604 chinerist C May 14, 2023, 3:31 p.m. OK PyPy 3-64 TESTS 50 545 108646400 2600
205930043 Spheniscine C May 15, 2023, 12:22 a.m. OK Rust 2021 TESTS 50 31 12697600 2600
205929978 Spheniscine C May 15, 2023, 12:20 a.m. OK Rust 2021 TESTS 50 31 12697600 2600
205929714 Spheniscine C May 15, 2023, 12:10 a.m. OK Rust 2021 TESTS 50 62 12697600 2600
205894916 sansen C May 14, 2023, 4:12 p.m. OK Rust 2021 TESTS 50 77 37376000 2600
206160924 kost C May 16, 2023, 11:40 p.m. OK Rust 2021 TESTS 51 124 12083200 2600
206414230 niyaznigmatul C May 19, 2023, 7:10 a.m. OK Rust 2021 TESTS 51 280 124928000 2600

remove filters

Back to search problems