Good Bye 2024: 2025 is NEAR

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
2053 Good Bye 2024: 2025 is NEAR FINISHED False 10800 41009123 Dec. 28, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 224 ) G Naive String Splits PROGRAMMING brute force greedy hashing strings

Cocoly has a string (t) of length (m), consisting of lowercase English letters, and he would like to split it into parts. He calls a pair of strings ((x, y)) beautiful if and only if there exists a sequence of strings (a_1, a_2, \ldots, a_k), such that: (t = a_1 + a_2 + \ldots + a_k), where (+) denotes string concatenation. For each (1 \leq i \leq k), at least one of the following holds: (a_i = x), or (a_i = y). Cocoly has another string (s) of length (n), consisting of lowercase English letters. Now, for each (1 \leq i < n), Cocoly wants you to determine whether the pair of strings ((s_1s_2 \ldots s_i, \, s_{i+1}s_{i+2} \ldots s_n)) is beautiful . Note : since the input and output are large, you may need to optimize them for this problem. For example, in C++, it is enough to use the following lines at the start of the main() function: Each test contains multiple test cases. The first line contains an integer (T) ((1 \leq T \leq 10^5)) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ((2 \leq n \leq m \leq 5 \cdot 10^6)) — the lengths of (s) and the length of (t). The second line of each test case contains a single string (s) of length (n), consisting only of lowercase English letters. The third line of each test case contains a single string (t) of length (m), consisting only of lowercase English letters. It is guaranteed that the sum of (m) over all test cases does not exceed (10^7). For each test case, output a single binary string (r) of length (n - 1): for each (1 \leq i < n), if the (i)-th pair is beautiful, (r_i=1); otherwise, (r_i=0). Do not output spaces. In the first test case, (s = \tt aba), (t = \tt ababa). For (i = 1): Cocoly can split (t = a + ba + ba), so the string pa

Tutorials

Good Bye 2024: 2025 is NEAR Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
298898124 mike286928 G Dec. 28, 2024, 6:59 p.m. OK C++17 (GCC 7-32) TESTS 63 3796 129740800
298895257 wutongchun G Dec. 28, 2024, 6:34 p.m. OK C++17 (GCC 7-32) TESTS 63 5015 160358400
298883325 AmShZ G Dec. 28, 2024, 5:06 p.m. OK C++17 (GCC 7-32) TESTS 63 7546 210022400
298925618 hyman00 G Dec. 29, 2024, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 63 733 344576000
298925767 hyman00 G Dec. 29, 2024, 5:43 a.m. OK C++20 (GCC 13-64) TESTS 63 749 359014400
298926086 hyman00 G Dec. 29, 2024, 5:48 a.m. OK C++20 (GCC 13-64) TESTS 63 874 295628800
298920582 hyman00 G Dec. 29, 2024, 4:01 a.m. OK C++20 (GCC 13-64) TESTS 63 1046 344576000
298898012 Ormlis G Dec. 28, 2024, 6:58 p.m. OK C++20 (GCC 13-64) TESTS 63 2484 166195200
298885848 elhoicyv G Dec. 28, 2024, 5:16 p.m. OK C++20 (GCC 13-64) TESTS 63 2687 179404800
298908593 Golovanov399 G Dec. 28, 2024, 9:45 p.m. OK C++20 (GCC 13-64) TESTS 63 3156 134144000
298919142 crazy_sea G Dec. 29, 2024, 3:29 a.m. OK C++20 (GCC 13-64) TESTS 63 3390 261632000
298915990 qiuzx G Dec. 29, 2024, 2:04 a.m. OK C++20 (GCC 13-64) TESTS 63 3812 126976000
298915584 Licha06 G Dec. 29, 2024, 1:51 a.m. OK C++20 (GCC 13-64) TESTS 63 3812 126976000
298885407 JoesSR G Dec. 28, 2024, 5:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 2155 168755200
298904701 Benq G Dec. 28, 2024, 8:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 2296 154521600
298882681 Benq G Dec. 28, 2024, 5:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 2421 154316800
298880377 Nachia G Dec. 28, 2024, 4:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 3749 144486400
298890046 jiangly G Dec. 28, 2024, 5:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 4124 239718400
298921620 GroupMatrix G Dec. 29, 2024, 4:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 63 4499 305254400
298881806 Petr G Dec. 28, 2024, 5:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 4593 274636800
298921573 GroupMatrix G Dec. 29, 2024, 4:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 63 4640 305254400
298897720 Ashidaka G Dec. 28, 2024, 6:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 63 4843 174387200
298921438 GroupMatrix G Dec. 29, 2024, 4:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 63 5499 505548800
298903190 rainboy G Dec. 28, 2024, 8:06 p.m. OK GNU C11 TESTS 63 3437 140390400

remove filters

Back to search problems