Codeforces Round 791 (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
1679 Codeforces Round 791 (Div. 2) FINISHED False 7200 84745463 May 14, 2022, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1246 ) E Typical Party in Dorm PROGRAMMING bitmasks brute force combinatorics dp strings two pointers

B'Today is a holiday in the residence hall -- Oleh arrived, in honor of which the girls gave him a string. Oleh liked the gift a lot, so he immediately thought up and offered you, his best friend, the following problem. You are given a string s of length n , which consists of the first 17 lowercase Latin letters { a , b , c , ldots , p , q } and question marks. And q queries. Each query is defined by a set of pairwise distinct lowercase first 17 letters of the Latin alphabet, which can be used to replace the question marks in the string s . The answer to the query is the sum of the number of distinct substrings that are palindromes over all strings that can be obtained from the original string s by replacing question marks with available characters. The answer must be calculated modulo 998 ,244 ,353 . Pay attention! Two substrings are different when their start and end positions in the string are different. So, the number of different substrings that are palindromes for the string aba will be 4 : a, b, a, aba. Consider examples of replacing question marks with letters. For example, from the string aba??ee when querying { a , b } you can get the strings ababaee or abaaaee but you cannot get the strings pizza, abaee, abacaba, aba?fee, aba47ee, or abatree. Recall that a palindrome is a string that reads the same from left to right as from right to left. The first line contains a single integer n ( 1 <= n <= 1 ,000 ) -- the length of the string s . The second line contains the string s , which consists of n lowercase Latin letters and question marks. It is guaranteed that all letters in the string belong to the set { a , b , c , ldots , p , q }. The third line contains a single integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of queries. This is followed by q lines, each containing a single '...

Tutorials

Codeforces Round #791 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
157197090 Delta-Sagittarius E May 14, 2022, 11:27 a.m. OK FPC TESTS 36 967 19456000
157247176 KrK E May 14, 2022, 10:18 p.m. OK GNU C++14 TESTS 37 186 10649600
157196486 suzhen E May 14, 2022, 11:25 a.m. OK GNU C++14 TESTS 36 186 24268800
157206721 shdut0901 E May 14, 2022, 12:54 p.m. OK GNU C++14 TESTS 36 202 10547200
157254103 bruhify E May 15, 2022, 2:54 a.m. OK GNU C++14 TESTS 37 202 20684800
157197420 malchik_v_balenciaga E May 14, 2022, 11:28 a.m. OK GNU C++14 TESTS 36 217 55808000
157218944 refresh888 E May 14, 2022, 2:47 p.m. OK GNU C++14 TESTS 37 218 10752000
157254814 Nightsky-yekong E May 15, 2022, 3:10 a.m. OK GNU C++14 TESTS 37 265 46284800
157249748 zltzlt E May 14, 2022, 11:59 p.m. OK GNU C++14 TESTS 37 295 22220800
157249780 zltzlt E May 15, 2022, midnight OK GNU C++14 TESTS 37 296 22732800
157207484 Phantasy E May 14, 2022, 12:59 p.m. OK GNU C++14 TESTS 36 342 19251200
157260788 applese E May 15, 2022, 5:18 a.m. OK GNU C++17 TESTS 37 171 10547200
157234800 Turkhuuu E May 14, 2022, 5:31 p.m. OK GNU C++17 TESTS 37 187 18739200
157208593 lzoilxy E May 14, 2022, 1:07 p.m. OK GNU C++17 TESTS 36 187 91648000
157260158 wifiiii E May 15, 2022, 5:10 a.m. OK GNU C++17 TESTS 37 202 19763200
157262362 Aging1986 E May 15, 2022, 5:39 a.m. OK GNU C++17 TESTS 37 217 11264000
157239959 MrDemon E May 14, 2022, 6:43 p.m. OK GNU C++17 TESTS 37 265 27136000
157207016 WYJ20154348 E May 14, 2022, 12:55 p.m. OK GNU C++17 TESTS 36 280 31334400
157260968 885377999 E May 15, 2022, 5:20 a.m. OK GNU C++17 TESTS 37 295 10547200
157197755 Hasan0540 E May 14, 2022, 11:29 a.m. OK GNU C++17 TESTS 36 373 13721600
157199681 perdu E May 14, 2022, 11:33 a.m. OK GNU C++17 TESTS 36 373 73728000
157197565 ohsolution E May 14, 2022, 11:28 a.m. OK GNU C++17 (64) TESTS 36 155 42496000
157217112 Nutella3000 E May 14, 2022, 2:32 p.m. OK GNU C++17 (64) TESTS 37 171 19046400
157217979 Perpetually_Purple E May 14, 2022, 2:39 p.m. OK GNU C++17 (64) TESTS 37 171 53862400
157209995 Actual_Girl E May 14, 2022, 1:18 p.m. OK GNU C++17 (64) TESTS 36 171 53862400
157204324 Ichinose_Honami E May 14, 2022, 12:41 p.m. OK GNU C++17 (64) TESTS 36 186 13926400
157231105 huangxiaohua E May 14, 2022, 4:48 p.m. OK GNU C++17 (64) TESTS 37 187 96358400
157243276 DmitryLzr E May 14, 2022, 7:48 p.m. OK GNU C++17 (64) TESTS 37 202 10649600
157244870 rishit3234 E May 14, 2022, 8:47 p.m. OK GNU C++17 (64) TESTS 37 249 53350400
157205290 tricyzhkx E May 14, 2022, 12:45 p.m. OK GNU C++17 (64) TESTS 36 296 12492800
157246717 antguz E May 14, 2022, 10:03 p.m. OK GNU C++17 (64) TESTS 37 358 20172800

remove filters

Back to search problems