IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + 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
2061 IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) FINISHED False 10800 39021923 Jan. 20, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 149 ) F2 Kevin and Binary String (Hard Version) PROGRAMMING data structures dp

This is the hard version of the problem. The difference between the versions is that in this version, string (t) consists of '0', '1' and '?'. You can hack only if you solved all versions of this problem. Kevin has a binary string (s) of length (n). Kevin can perform the following operation: Choose two adjacent blocks of (s) and swap them. A block is a maximal substring(^{\text{∗}}) of identical characters. Formally, denote (sl,r) as the substring (s_l s_{l+1} \ldots s_r). A block is (sl,r) satisfying: (l=1) or (s_l\not=s_{l-1}). (s_l=s_{l+1} = \ldots = s_{r}). (r=n) or (s_r\not=s_{r+1}). Adjacent blocks are two blocks (sl_1,r_1) and (sl_2,r_2) satisfying (r_1+1=l_2). For example, if (s=\mathtt{000}\,\mathbf{11}\,\mathbf{00}\,\mathtt{111}), Kevin can choose the two blocks (s4,5) and (s6,7) and swap them, transforming (s) into (\mathtt{000}\,\mathbf{00}\,\mathbf{11}\,\mathtt{111}). Given a string (t) of length (n) consisting of '0', '1' and '?', Kevin wants to determine the minimum number of operations required to perform such that for any index (i) ((1\le i\le n)), if (t_i\not=) '?' then (s_i=t_i). If it is impossible, output (-1). (^{\text{∗}})A string (a) is a substring of a string (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end. 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 a string (s) consisting of '0' and '1'. The second line of each test case contains a string (t) consisting of '0', '1' and '?' . It is guaranteed that the lengths of (s) and (t) are the same. It is guaranteed that the sum of the length of $$

Tutorials

IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
302165783 pavement F2 Jan. 21, 2025, 3:07 a.m. OK C++17 (GCC 7-32) TESTS 64 343 80896000
302169653 recollect_ii F2 Jan. 21, 2025, 3:54 a.m. OK C++17 (GCC 7-32) TESTS 64 390 79974400
302128136 potato167 F2 Jan. 20, 2025, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 64 499 28672000
302165854 zjy2008 F2 Jan. 21, 2025, 3:07 a.m. OK C++17 (GCC 7-32) TESTS 64 999 30720000
302177599 include_BM F2 Jan. 21, 2025, 5:33 a.m. OK C++20 (GCC 13-64) TESTS 64 265 46387200
302178465 include_BM F2 Jan. 21, 2025, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 64 265 46489600
302127501 BurnedChicken F2 Jan. 20, 2025, 5:31 p.m. OK C++20 (GCC 13-64) TESTS 64 342 61030400
302121698 JDScript0117 F2 Jan. 20, 2025, 5:13 p.m. OK C++20 (GCC 13-64) TESTS 64 421 21913600
302134355 StarSilk F2 Jan. 20, 2025, 6:39 p.m. OK C++20 (GCC 13-64) TESTS 64 421 34304000
302121228 E_fireworks F2 Jan. 20, 2025, 5:11 p.m. OK C++20 (GCC 13-64) TESTS 64 421 62668800
302161470 Aimbyek F2 Jan. 21, 2025, 2:04 a.m. OK C++20 (GCC 13-64) TESTS 64 1156 36147200
302178819 Dominater069 F2 Jan. 21, 2025, 5:45 a.m. OK C++20 (GCC 13-64) TESTS 64 1561 74137600
302158593 jeroenodb F2 Jan. 21, 2025, 1:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 155 37580800
302158981 jeroenodb F2 Jan. 21, 2025, 1:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 156 37273600
302158740 jeroenodb F2 Jan. 21, 2025, 1:19 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 171 36966400
302155955 jeroenodb F2 Jan. 21, 2025, 12:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 217 46489600
302118052 ecnerwala F2 Jan. 20, 2025, 5:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 233 32768000
302158231 antontrygubO_o F2 Jan. 21, 2025, 1:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 327 40345600
302142081 noimi F2 Jan. 20, 2025, 7:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 327 45977600
302158287 antontrygubO_o F2 Jan. 21, 2025, 1:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 421 41164800
302177494 XY_Eleven F2 Jan. 21, 2025, 5:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 452 61542400
302148761 TKT_YI F2 Jan. 20, 2025, 9:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 608 108032000
302152291 rainboy F2 Jan. 20, 2025, 10:40 p.m. OK GNU C11 TESTS 64 218 24883200

remove filters

Back to search problems