Codeforces Round 825 (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
1736 Codeforces Round 825 (Div. 2) FINISHED False 7200 66410699 Oct. 10, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2522 ) D Equal Binary Subsequences PROGRAMMING constructive algorithms greedy strings

B'Everool has a binary string s of length 2n . Note that a binary string is a string consisting of only characters 0 and 1 . He wants to partition s into two disjoint equal subsequences. He needs your help to do it. You are allowed to do the following operation exactly once. In other words, you can select a sequence of indices b_1, b_2, ldots, b_m , where 1 <= b_1 < b_2 < ldots < b_m <= 2n . After that you simultaneously set s_{b_1} := s_{b_m}, s_{b_2} := s_{b_1}, ldots, s_{b_m} := s_{b_{m-1}}. Can you partition s into two disjoint equal subsequences after performing the allowed operation exactly once? A partition of s into two disjoint equal subsequences s^p and s^q is two increasing arrays of indices p_1, p_2, ldots, p_n and q_1, q_2, ldots, q_n , such that each integer from 1 to 2n is encountered in either p or q exactly once, s^p = s_{p_1} s_{p_2} ldots s_{p_n} , s^q = s_{q_1} s_{q_2} ldots s_{q_n} , and s^p = s^q . If it is not possible to partition after performing any kind of operation, report -1 . If it is possible to do the operation and partition s into two disjoint subsequences s^p and s^q , such that s^p = s^q , print elements of b and indices of s^p , i. e. the values p_1, p_2, ldots, p_n . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^5 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ), where 2n is the length of the binary string. The second line of each test case contains the binary string s of length 2n . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, follow the following output format. If there is n'...

Tutorials

Codeforces Round #825 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
175492566 chrisfcoder D Oct. 11, 2022, 2:58 a.m. OK C# 10 TESTS 12 77 7168000
175447138 yehaodxv D Oct. 10, 2022, 5:22 p.m. OK GNU C++14 TESTS 12 15 4198400
175504024 lqr2018 D Oct. 11, 2022, 5:58 a.m. OK GNU C++14 TESTS 12 31 614400
175497496 AIM-9M D Oct. 11, 2022, 4:30 a.m. OK GNU C++14 TESTS 12 31 716800
175492299 Jonah_Lan D Oct. 11, 2022, 2:53 a.m. OK GNU C++14 TESTS 12 31 716800
175490939 omeganot D Oct. 11, 2022, 2:28 a.m. OK GNU C++14 TESTS 12 31 716800
175483967 wuzhijie D Oct. 10, 2022, 11:30 p.m. OK GNU C++14 TESTS 12 31 716800
175466144 Bedo_Sayed D Oct. 10, 2022, 8:49 p.m. OK GNU C++14 TESTS 12 31 716800
175456054 batyousef D Oct. 10, 2022, 6:36 p.m. OK GNU C++14 TESTS 12 31 716800
175450692 pingbai D Oct. 10, 2022, 5:48 p.m. OK GNU C++14 TESTS 12 31 716800
175495260 AIM-9M D Oct. 11, 2022, 3:49 a.m. OK GNU C++14 TESTS 12 31 819200
175460169 Ignut D Oct. 10, 2022, 7:23 p.m. OK GNU C++17 TESTS 12 30 819200
175486396 OutsiderZz D Oct. 11, 2022, 12:49 a.m. OK GNU C++17 TESTS 12 30 2048000
175465157 dredwerkz D Oct. 10, 2022, 8:33 p.m. OK GNU C++17 TESTS 12 31 614400
175499636 hututu-7 D Oct. 11, 2022, 5:02 a.m. OK GNU C++17 TESTS 12 31 716800
175499044 NanZaaa D Oct. 11, 2022, 4:54 a.m. OK GNU C++17 TESTS 12 31 716800
175493396 lbntxdy D Oct. 11, 2022, 3:13 a.m. OK GNU C++17 TESTS 12 31 716800
175492455 chicking D Oct. 11, 2022, 2:56 a.m. OK GNU C++17 TESTS 12 31 716800
175491529 blankff D Oct. 11, 2022, 2:39 a.m. OK GNU C++17 TESTS 12 31 716800
175488592 2e8_konjak D Oct. 11, 2022, 1:40 a.m. OK GNU C++17 TESTS 12 31 716800
175485698 kylinever D Oct. 11, 2022, 12:28 a.m. OK GNU C++17 TESTS 12 31 716800
175442673 heeye D Oct. 10, 2022, 4:33 p.m. OK GNU C++17 (64) TESTS 12 30 1024000
175446905 Eter.nal D Oct. 10, 2022, 5:21 p.m. OK GNU C++17 (64) TESTS 12 30 1228800
175495746 Rick_GT D Oct. 11, 2022, 3:58 a.m. OK GNU C++17 (64) TESTS 12 31 716800
175481082 colossal_pepe D Oct. 10, 2022, 10 p.m. OK GNU C++17 (64) TESTS 12 31 716800
175440992 Whereismybrain D Oct. 10, 2022, 4:30 p.m. OK GNU C++17 (64) TESTS 12 31 716800
175498559 jtf_shine D Oct. 11, 2022, 4:46 a.m. OK GNU C++17 (64) TESTS 12 31 819200
175498106 pavankalyanpallapolu D Oct. 11, 2022, 4:39 a.m. OK GNU C++17 (64) TESTS 12 31 819200
175496933 zhangboju D Oct. 11, 2022, 4:20 a.m. OK GNU C++17 (64) TESTS 12 31 819200
175494380 Time_JYF D Oct. 11, 2022, 3:32 a.m. OK GNU C++17 (64) TESTS 12 31 819200
175492628 Lycorisss D Oct. 11, 2022, 3 a.m. OK GNU C++17 (64) TESTS 12 31 819200
175447618 bachbeo2007 D Oct. 10, 2022, 5:25 p.m. OK GNU C++20 (64) TESTS 12 15 512000
175497305 IIIIndex D Oct. 11, 2022, 4:26 a.m. OK GNU C++20 (64) TESTS 12 15 819200
175450853 magnus.hegdahl D Oct. 10, 2022, 5:49 p.m. OK GNU C++20 (64) TESTS 12 15 819200
175448369 Casio991ms D Oct. 10, 2022, 5:29 p.m. OK GNU C++20 (64) TESTS 12 15 819200
175447701 Tatsuyaaaa D Oct. 10, 2022, 5:25 p.m. OK GNU C++20 (64) TESTS 12 15 819200
175455705 freakin23 D Oct. 10, 2022, 6:32 p.m. OK GNU C++20 (64) TESTS 12 15 921600
175447156 LLL_2820 D Oct. 10, 2022, 5:22 p.m. OK GNU C++20 (64) TESTS 12 15 921600
175502042 LetsPlayUtkarsh D Oct. 11, 2022, 5:34 a.m. OK GNU C++20 (64) TESTS 12 15 1331200
175459994 aaditya_20 D Oct. 10, 2022, 7:21 p.m. OK GNU C++20 (64) TESTS 12 15 1331200
175459080 SashaT9 D Oct. 10, 2022, 7:10 p.m. OK GNU C++20 (64) TESTS 12 15 1331200
175495036 kun2605879979 D Oct. 11, 2022, 3:44 a.m. OK MS C++ 2017 TESTS 12 109 17612800
175447682 hxu10 D Oct. 10, 2022, 5:25 p.m. OK PyPy 3 TESTS 12 249 10240000
175466223 titia D Oct. 10, 2022, 8:50 p.m. OK PyPy 3-64 TESTS 12 140 10956800
175452335 sushmanth.dampur8780 D Oct. 10, 2022, 6:02 p.m. OK PyPy 3-64 TESTS 12 202 11161600
175447169 my_brain_sucks D Oct. 10, 2022, 5:22 p.m. OK PyPy 3-64 TESTS 12 202 11878400
175448576 1_2_3_4_5_9 D Oct. 10, 2022, 5:31 p.m. OK PyPy 3-64 TESTS 12 217 25190400
175490212 mkawa2 D Oct. 11, 2022, 2:15 a.m. OK PyPy 3-64 TESTS 12 218 12800000
175446593 roaris D Oct. 10, 2022, 5:20 p.m. OK PyPy 3-64 TESTS 12 218 21401600
175462631 jaglike_makkar D Oct. 10, 2022, 7:55 p.m. OK PyPy 3-64 TESTS 12 233 12185600
175451464 ishaanshri95 D Oct. 10, 2022, 5:55 p.m. OK PyPy 3-64 TESTS 12 468 20787200
175488294 Mrs.Zhao D Oct. 11, 2022, 1:34 a.m. OK Python 3 TESTS 12 343 3584000

remove filters

Back to search problems