Codeforces Round 1079 (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
2196 Codeforces Round 1079 (Div. 1) FINISHED False 10800 5585123 Feb. 11, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 192 ) E2 Fuzzy Concatenation (Hard version) PROGRAMMING binary search data structures dp greedy string suffix structures

This is the hard version of the problem. The difference between the versions is that in this version, (n \le 5 \cdot 10^{5}, m \le 5 \cdot 10^{4}). You can hack only if you solved all versions of this problem. There are two strings (s) and (t), both consisting of lowercase Latin letters. You also have an empty string (p). You can perform the following operation, which consists of several stages: choose any two integers (l) and (r) ((1 \le l \le r \le |s|)); copy the substring (s_{l},\ldots, s_{r}) and append it to the end of string (p); among the last (r - l + 1) characters of string (p), change at most one character to any lowercase Latin letter. For example, if the string (s =) " dhhtyhwbsl " and (p =) "", you can choose (l = 3, r = 6) and add " htyh " to the end of (p), and then change the character " y " to " a ", resulting in (p =) " htah ". Your task is to determine the minimum number of operations required for string (p) to become equal to (t). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ((1 \le n \le 5 \cdot 10^{5}, 1 \le m \le 5 \cdot 10^{4})) — the lengths of strings (s) and (t). The second line of each test case contains the string (s) of length (n), consisting of lowercase Latin letters. The third line of each test case contains the string (t) of length (m), consisting of lowercase Latin letters. It is guaranteed that the sum of (n) across all test cases does not exceed (5 \cdot 10^{5}), and the sum of (m) across all test cases does not exceed (5 \cdot 10^{4}). For each test case, output a single integer — the answer to the problem. In the first test case, you can take the substring («\mathtt{a}») from the string (s), change a

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
362550068 Potassium E2 Feb. 11, 2026, 9:06 p.m. OK C++17 (GCC 7-32) TESTS 57 234 173670400
362554797 Iron_china E2 Feb. 11, 2026, 10:30 p.m. OK C++17 (GCC 7-32) TESTS 57 1171 67993600
362565601 potato167 E2 Feb. 12, 2026, 3:02 a.m. OK C++17 (GCC 7-32) TESTS 57 1812 102400
362565747 potato167 E2 Feb. 12, 2026, 3:05 a.m. OK C++17 (GCC 7-32) TESTS 57 1843 102400
362565699 potato167 E2 Feb. 12, 2026, 3:04 a.m. OK C++17 (GCC 7-32) TESTS 57 1859 102400
362567205 potato167 E2 Feb. 12, 2026, 3:30 a.m. OK C++17 (GCC 7-32) TESTS 57 1921 102400
362567163 potato167 E2 Feb. 12, 2026, 3:30 a.m. OK C++17 (GCC 7-32) TESTS 57 1984 102400
362567132 potato167 E2 Feb. 12, 2026, 3:29 a.m. OK C++17 (GCC 7-32) TESTS 57 2000 102400
362565783 potato167 E2 Feb. 12, 2026, 3:06 a.m. OK C++17 (GCC 7-32) TESTS 57 2000 102400
362570098 keisuke6 E2 Feb. 12, 2026, 4:07 a.m. OK C++17 (GCC 7-32) TESTS 57 2968 102400
362492888 imirdy E2 Feb. 11, 2026, 4:22 p.m. OK C++20 (GCC 13-64) TESTS 57 156 128409600
362483591 __baozii__ E2 Feb. 11, 2026, 4:05 p.m. OK C++20 (GCC 13-64) TESTS 57 625 31436800
362567963 yangchang E2 Feb. 12, 2026, 3:42 a.m. OK C++20 (GCC 13-64) TESTS 57 906 56320000
362538457 Noobish_Monk E2 Feb. 11, 2026, 7:02 p.m. OK C++20 (GCC 13-64) TESTS 57 1031 185651200
362545000 tsunk E2 Feb. 11, 2026, 8:03 p.m. OK C++20 (GCC 13-64) TESTS 57 1203 1740800
362576056 shqrky E2 Feb. 12, 2026, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 57 1281 61030400
362544272 tsunk E2 Feb. 11, 2026, 7:55 p.m. OK C++20 (GCC 13-64) TESTS 57 1312 102400
362543927 tsunk E2 Feb. 11, 2026, 7:52 p.m. OK C++20 (GCC 13-64) TESTS 57 1312 102400
362545234 tsunk E2 Feb. 11, 2026, 8:05 p.m. OK C++20 (GCC 13-64) TESTS 57 1328 1740800
362508728 OG_Matveychick1 E2 Feb. 11, 2026, 4:53 p.m. OK C++20 (GCC 13-64) TESTS 57 1406 1843200
362497074 turmax E2 Feb. 11, 2026, 4:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 437 163123200
362534829 Denisov E2 Feb. 11, 2026, 6:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 765 23449600
362506491 allvik66 E2 Feb. 11, 2026, 4:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 984 104243200
362504186 geospiza E2 Feb. 11, 2026, 4:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1000 102400
362549381 Wansur E2 Feb. 11, 2026, 8:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1015 248320000
362553553 CasseShimada E2 Feb. 11, 2026, 10:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1031 102400
362534085 maspy E2 Feb. 11, 2026, 6:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1093 614400
362519061 whu_loser E2 Feb. 11, 2026, 5:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1109 1945600
362536866 VivaciousAubergine E2 Feb. 11, 2026, 6:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1140 4505600
362459515 maspy E2 Feb. 11, 2026, 3:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 57 1156 614400
362563425 smilences E2 Feb. 12, 2026, 2:19 a.m. OK PyPy 3-64 TESTS 57 1687 186675200
362479984 Egor E2 Feb. 11, 2026, 3:59 p.m. OK Rust 2024 TESTS 57 1359 11776000
362523818 Sugar_fan E2 Feb. 11, 2026, 5:26 p.m. OK Rust 2024 TESTS 57 2406 180019200

remove filters

Back to search problems