Codeforces Round 820 (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
1729 Codeforces Round 820 (Div. 3) FINISHED False 8100 74273063 Sept. 12, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2250 ) G Cut Substrings PROGRAMMING combinatorics dp hashing strings two pointers

B'You are given two non-empty strings s and t , consisting of Latin letters. In one move, you can choose an occurrence of the string t in the string s and replace it with dots. Your task is to remove all occurrences of the string t in the string s in the minimum number of moves, and also calculate how many different sequences of moves of the minimum length exist. Two sequences of moves are considered different if the sets of indices at which the removed occurrences of the string t in s begin differ. For example, the sets {1, 2, 3 } and {1, 2, 4 } are considered different, the sets {2, 4, 6 } and {2, 6 } -- too, but sets {3, 5 } and {5, 3 } -- not. For example, let the string s = "abababacababa" and the string t = "aba". We can remove all occurrences of the string t in 2 moves by cutting out the occurrences of the string t at the 3 th and 9 th positions. In this case, the string s is an example of the form "ab...bac...ba". It is also possible to cut occurrences of the string t at the 3 th and 11 th positions. There are two different sequences of minimum length moves. Since the answer can be large, output it modulo 10^9 + 7 . The first line of the input contains a single integer q ( 1 <= q <= 50 ) -- the number of test cases. The descriptions of the sets follow. The first line of each set contains a non-empty string s ( 1 <= |s| <= 500 ) consisting of lowercase Latin letters. The second line of each set contains a non-empty string t ( 1 <= |t| <= 500 ) consisting of lowercase Latin letters. It is guaranteed that the sum of string lengths s over all test cases does not exceed 500 . Similarly, it is guaranteed that the sum of string lengths t over all test cases does not exceed 500 . For each test case print two integers -- the minimum number of m'...

Tutorials

Codeforces Round #820 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
171983615 unknowndriver G Sept. 13, 2022, 2:35 a.m. OK GNU C++14 TESTS 87 15 0
171953556 _Subrata G Sept. 12, 2022, 5:33 p.m. OK GNU C++14 TESTS 87 15 0
171947825 NguyenHuuNhatQuang G Sept. 12, 2022, 5:01 p.m. OK GNU C++14 TESTS 87 15 0
171994010 classic G Sept. 13, 2022, 5:40 a.m. OK GNU C++14 TESTS 87 15 102400
171983794 christchurch G Sept. 13, 2022, 2:39 a.m. OK GNU C++14 TESTS 87 15 102400
171973386 aditya_70 G Sept. 12, 2022, 9:43 p.m. OK GNU C++14 TESTS 87 15 102400
171986011 christchurch G Sept. 13, 2022, 3:25 a.m. OK GNU C++14 TESTS 87 15 204800
171970747 EJOI_Gold G Sept. 12, 2022, 8:48 p.m. OK GNU C++14 TESTS 87 15 204800
171964703 obaydullahmhs G Sept. 12, 2022, 7:17 p.m. OK GNU C++14 TESTS 87 15 1228800
171992338 duck_pear G Sept. 13, 2022, 5:16 a.m. OK GNU C++14 TESTS 87 15 2252800
171990236 BhavayGoyal G Sept. 13, 2022, 4:44 a.m. OK GNU C++17 TESTS 87 15 0
171985636 error_miao G Sept. 13, 2022, 3:18 a.m. OK GNU C++17 TESTS 87 15 0
171984560 brightboyz G Sept. 13, 2022, 2:56 a.m. OK GNU C++17 TESTS 87 15 0
171974039 pandaforever G Sept. 12, 2022, 10 p.m. OK GNU C++17 TESTS 87 15 0
171954995 yash523 G Sept. 12, 2022, 5:44 p.m. OK GNU C++17 TESTS 87 15 0
171988792 Love_Youuu G Sept. 13, 2022, 4:20 a.m. OK GNU C++17 TESTS 87 15 102400
171985697 liu_lucifer G Sept. 13, 2022, 3:20 a.m. OK GNU C++17 TESTS 87 15 102400
171983786 christchurch G Sept. 13, 2022, 2:39 a.m. OK GNU C++17 TESTS 87 15 102400
171956785 Nolv G Sept. 12, 2022, 5:58 p.m. OK GNU C++17 TESTS 87 15 102400
171950687 noya2 G Sept. 12, 2022, 5:14 p.m. OK GNU C++17 TESTS 87 15 102400
171990599 gqf123 G Sept. 13, 2022, 4:50 a.m. OK GNU C++17 (64) TESTS 87 15 0
171990557 Yumee G Sept. 13, 2022, 4:49 a.m. OK GNU C++17 (64) TESTS 87 15 0
171987642 MarcosK G Sept. 13, 2022, 4:01 a.m. OK GNU C++17 (64) TESTS 87 15 0
171986019 Kaiser_Kell G Sept. 13, 2022, 3:25 a.m. OK GNU C++17 (64) TESTS 87 15 0
171985953 euoao G Sept. 13, 2022, 3:24 a.m. OK GNU C++17 (64) TESTS 87 15 0
171976122 enslaved G Sept. 12, 2022, 11:01 p.m. OK GNU C++17 (64) TESTS 87 15 0
171970283 freehandle G Sept. 12, 2022, 8:39 p.m. OK GNU C++17 (64) TESTS 87 15 0
171957606 propane G Sept. 12, 2022, 6:06 p.m. OK GNU C++17 (64) TESTS 87 15 0
171956674 dimss G Sept. 12, 2022, 5:57 p.m. OK GNU C++17 (64) TESTS 87 15 0
171955886 YiYangQianXi G Sept. 12, 2022, 5:52 p.m. OK GNU C++17 (64) TESTS 87 15 0
171994863 Penguin07 G Sept. 13, 2022, 5:51 a.m. OK GNU C++20 (64) TESTS 87 15 0
171991300 mknayam G Sept. 13, 2022, 5:01 a.m. OK GNU C++20 (64) TESTS 87 15 0
171986950 LittleSeaMonster G Sept. 13, 2022, 3:46 a.m. OK GNU C++20 (64) TESTS 87 15 0
171986305 rgnerdplayer G Sept. 13, 2022, 3:31 a.m. OK GNU C++20 (64) TESTS 87 15 0
171984568 Mryange G Sept. 13, 2022, 2:56 a.m. OK GNU C++20 (64) TESTS 87 15 0
171984505 LuluOwO G Sept. 13, 2022, 2:55 a.m. OK GNU C++20 (64) TESTS 87 15 0
171983412 christchurch G Sept. 13, 2022, 2:30 a.m. OK GNU C++20 (64) TESTS 87 15 0
171982153 Mryange G Sept. 13, 2022, 2:01 a.m. OK GNU C++20 (64) TESTS 87 15 0
171972287 p3rfect G Sept. 12, 2022, 9:18 p.m. OK GNU C++20 (64) TESTS 87 15 0
171964688 srikar03 G Sept. 12, 2022, 7:17 p.m. OK GNU C++20 (64) TESTS 87 15 0
171979824 dzhi G Sept. 13, 2022, 1:03 a.m. OK Java 11 TESTS 87 187 0
171979647 dzhi G Sept. 13, 2022, 12:58 a.m. OK Java 11 TESTS 87 187 0
171967713 profchi G Sept. 12, 2022, 7:57 p.m. OK Java 11 TESTS 87 202 0
171973931 NerfThis G Sept. 12, 2022, 9:57 p.m. OK Java 8 TESTS 87 311 0
171964166 hxu10 G Sept. 12, 2022, 7:11 p.m. OK PyPy 3 TESTS 87 654 3174400
171953153 AndreySiunov G Sept. 12, 2022, 5:30 p.m. OK PyPy 3 TESTS 87 685 11878400
171952405 AndreySiunov G Sept. 12, 2022, 5:25 p.m. OK PyPy 3 TESTS 87 1606 11059200
171955452 huangxw G Sept. 12, 2022, 5:48 p.m. OK PyPy 3-64 TESTS 87 109 7270400
171956854 skhan_org G Sept. 12, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 87 233 14438400
171961803 horrlod G Sept. 12, 2022, 6:46 p.m. OK PyPy 3-64 TESTS 87 264 10854400
171958612 Aniket_Thora G Sept. 12, 2022, 6:14 p.m. OK PyPy 3-64 TESTS 87 1231 31334400
171952232 AndreySiunov G Sept. 12, 2022, 5:24 p.m. OK PyPy 3-64 TESTS 87 1996 18227200
171951081 sansen G Sept. 12, 2022, 5:17 p.m. OK Rust 2021 TESTS 87 15 0

remove filters

Back to search problems