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 |
---|---|---|---|---|---|---|
1889 | Codeforces Round 906 (Div. 1) | FINISHED | False | 9000 | 38676263 | Oct. 28, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 13677 ) | A | Qingshan Loves Strings 2 | PROGRAMMING | constructive algorithms greedy |
B'Qingshan has a string s which only contains texttt{0} and texttt{1} . A string a of length k is good if and only if For Div. 2 contestants, note that this condition is different from the condition in problem B. For example, texttt{10} , texttt{1010} , texttt{111000} are good, while texttt{11} , texttt{101} , texttt{001} , texttt{001100} are not good. Qingshan wants to make s good. To do this, she can do the following operation at most 300 times (possibly, zero): Please tell Qingshan if it is possible to make s good. If it is possible, print a sequence of operations that makes s good. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 100 ) -- the length of string s , respectively. The second line of each test case contains a string s with length n . It is guaranteed that s only consists of texttt{0} and texttt{1} . For each test case, if it impossible to make s good, output -1 . Otherwise, output p ( 0 <= p <= 300 ) -- the number of operations, in the first line. Then, output p integers in the second line. The i -th integer should be an index x_i ( 0 <= x_i <= n+2i-2 ) -- the position where you want to insert texttt{01} in the current s . If x_i=0 , you insert texttt{01} at the beginning of s . Otherwise, you insert texttt{01} immediately after the x_i -th character of s . We can show that under the constraints in this problem, if an answer exists, there is always an answer that requires at most 300 operations. In the first test case, you can do zero operations and get s= texttt{01} , which is good. '... |
Codeforces Round 906 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
230201692 | mban259 | A | Oct. 28, 2023, 2:58 p.m. | OK | C# 10 | TESTS | 18 | 61 | 614400 | ||
230194717 | KumaTachiRen | A | Oct. 28, 2023, 2:50 p.m. | OK | C# 8 | TESTS | 18 | 156 | 2150400 | ||
230189834 | hos.lyric | A | Oct. 28, 2023, 2:45 p.m. | OK | D | TESTS | 18 | 15 | 0 | ||
230209979 | Gassa | A | Oct. 28, 2023, 3:09 p.m. | OK | D | TESTS | 18 | 31 | 204800 | ||
230203828 | chro4896 | A | Oct. 28, 2023, 3:01 p.m. | OK | GNU C11 | TESTS | 18 | 31 | 0 | ||
230298702 | clly | A | Oct. 29, 2023, 1:12 a.m. | OK | GNU C++14 | TESTS | 18 | 0 | 0 | ||
230300855 | zyxawa | A | Oct. 29, 2023, 2:07 a.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230298105 | RobertoFirmino | A | Oct. 29, 2023, 12:55 a.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230297721 | Liooooo | A | Oct. 29, 2023, 12:41 a.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230301519 | clbclb | A | Oct. 29, 2023, 2:20 a.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230297603 | wzc_IOI_czw | A | Oct. 29, 2023, 12:36 a.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230294198 | Vishal_009 | A | Oct. 28, 2023, 10:33 p.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230235247 | FengLing | A | Oct. 28, 2023, 3:55 p.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230220698 | Mapakaka | A | Oct. 28, 2023, 3:27 p.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230301963 | luogu_bot4 | A | Oct. 29, 2023, 2:30 a.m. | OK | GNU C++14 | TESTS | 18 | 15 | 0 | ||
230199731 | E-ray | A | Oct. 28, 2023, 2:55 p.m. | OK | GNU C++17 | TESTS | 18 | 0 | 0 | ||
230265987 | mohamedeltair | A | Oct. 28, 2023, 5:36 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230217601 | pandaforever | A | Oct. 28, 2023, 3:22 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230214760 | spsicio | A | Oct. 28, 2023, 3:17 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230209128 | lddlinan | A | Oct. 28, 2023, 3:08 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230202801 | lvle | A | Oct. 28, 2023, 2:59 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230196598 | zjq123 | A | Oct. 28, 2023, 2:52 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230196464 | ExRoc__ | A | Oct. 28, 2023, 2:52 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230195006 | fengqiyuka | A | Oct. 28, 2023, 2:50 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230283485 | A_Ferrada.r | A | Oct. 28, 2023, 7:50 p.m. | OK | GNU C++17 | TESTS | 18 | 15 | 0 | ||
230315446 | YocyCraft | A | Oct. 29, 2023, 5:51 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230212997 | The_thought_of_fallout | A | Oct. 28, 2023, 3:14 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230211020 | torisasami | A | Oct. 28, 2023, 3:11 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230199005 | lsantire | A | Oct. 28, 2023, 2:55 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230195588 | SyruLoveNewTechnology | A | Oct. 28, 2023, 2:51 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230191099 | Lawali | A | Oct. 28, 2023, 2:47 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230188662 | Rubikun | A | Oct. 28, 2023, 2:44 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230187433 | hitonanode | A | Oct. 28, 2023, 2:43 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230308198 | Junaid077 | A | Oct. 29, 2023, 4:14 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 0 | ||
230206015 | Capps | A | Oct. 28, 2023, 3:04 p.m. | OK | GNU C++17 (64) | TESTS | 18 | 0 | 102400 | ||
230300369 | kernel-panic | A | Oct. 29, 2023, 1:57 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230315572 | Hectonit | A | Oct. 29, 2023, 5:52 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230305769 | joaozao | A | Oct. 29, 2023, 3:36 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230305377 | warner1129 | A | Oct. 29, 2023, 3:29 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230297483 | BARBARIANNNNN | A | Oct. 29, 2023, 12:32 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230284719 | Rabbi_hasan162 | A | Oct. 28, 2023, 8:04 p.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230283453 | khaledmohd202 | A | Oct. 28, 2023, 7:50 p.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230276699 | bibikov1 | A | Oct. 28, 2023, 6:46 p.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230273957 | kartik_garg163 | A | Oct. 28, 2023, 6:25 p.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230271432 | milind0110 | A | Oct. 28, 2023, 6:08 p.m. | OK | GNU C++20 (64) | TESTS | 18 | 0 | 0 | ||
230205858 | profchi | A | Oct. 28, 2023, 3:03 p.m. | OK | Java 11 | TESTS | 18 | 202 | 0 | ||
230221941 | TCchen | A | Oct. 28, 2023, 3:29 p.m. | OK | Java 11 | TESTS | 18 | 218 | 0 | ||
230195855 | taran_1407 | A | Oct. 28, 2023, 2:51 p.m. | OK | Java 11 | TESTS | 18 | 264 | 204800 | ||
230189594 | SecondThread | A | Oct. 28, 2023, 2:45 p.m. | OK | Java 8 | TESTS | 18 | 139 | 38502400 | ||
230299915 | coderman2004 | A | Oct. 29, 2023, 1:46 a.m. | OK | Java 8 | TESTS | 18 | 155 | 0 | ||
230256749 | Tlatoani | A | Oct. 28, 2023, 4:49 p.m. | OK | Kotlin 1.6 | TESTS | 18 | 218 | 0 | ||
230188953 | FastFreeTask | A | Oct. 28, 2023, 2:44 p.m. | OK | Kotlin 1.6 | TESTS | 18 | 233 | 0 | ||
230294014 | Furgoneta | A | Oct. 28, 2023, 10:28 p.m. | OK | MS C++ 2017 | TESTS | 18 | 15 | 0 | ||
230294051 | Furgoneta | A | Oct. 28, 2023, 10:29 p.m. | OK | MS C++ 2017 | TESTS | 18 | 30 | 0 | ||
230202566 | plevande | A | Oct. 28, 2023, 2:59 p.m. | OK | PyPy 3 | TESTS | 18 | 108 | 1945600 | ||
230195740 | SPD_9X2 | A | Oct. 28, 2023, 2:51 p.m. | OK | PyPy 3 | TESTS | 18 | 108 | 2560000 | ||
230194063 | tamato | A | Oct. 28, 2023, 2:49 p.m. | OK | PyPy 3 | TESTS | 18 | 139 | 3788800 | ||
230309882 | letamquang220805 | A | Oct. 29, 2023, 4:41 a.m. | OK | PyPy 3 | TESTS | 18 | 171 | 2969600 | ||
230208337 | Mukundan314 | A | Oct. 28, 2023, 3:07 p.m. | OK | PyPy 3-64 | TESTS | 18 | 92 | 4198400 | ||
230203997 | Kalyano | A | Oct. 28, 2023, 3:01 p.m. | OK | PyPy 3-64 | TESTS | 18 | 93 | 3379200 | ||
230185100 | toam | A | Oct. 28, 2023, 2:40 p.m. | OK | PyPy 3-64 | TESTS | 18 | 93 | 5017600 | ||
230193643 | whatshisbucket | A | Oct. 28, 2023, 2:49 p.m. | OK | PyPy 3-64 | TESTS | 18 | 108 | 3584000 | ||
230234504 | alxwen711 | A | Oct. 28, 2023, 3:54 p.m. | OK | PyPy 3-64 | TESTS | 18 | 108 | 3788800 | ||
230253731 | chinerist | A | Oct. 28, 2023, 4:41 p.m. | OK | PyPy 3-64 | TESTS | 18 | 108 | 4403200 | ||
230190213 | jatloe | A | Oct. 28, 2023, 2:46 p.m. | OK | PyPy 3-64 | TESTS | 18 | 108 | 5017600 | ||
230202576 | Alex239 | A | Oct. 28, 2023, 2:59 p.m. | OK | PyPy 3-64 | TESTS | 18 | 108 | 5120000 | ||
230212232 | shade34 | A | Oct. 28, 2023, 3:13 p.m. | OK | PyPy 3-64 | TESTS | 18 | 109 | 3584000 | ||
230202419 | little_young | A | Oct. 28, 2023, 2:59 p.m. | OK | PyPy 3-64 | TESTS | 18 | 109 | 4915200 | ||
230199818 | Jimanbanashi | A | Oct. 28, 2023, 2:56 p.m. | OK | Python 2 | TESTS | 18 | 62 | 0 | ||
230275188 | fasarten | A | Oct. 28, 2023, 6:34 p.m. | OK | Python 3 | TESTS | 18 | 46 | 0 | ||
230274928 | MdNazmulHossain | A | Oct. 28, 2023, 6:32 p.m. | OK | Python 3 | TESTS | 18 | 46 | 0 | ||
230198874 | forxen | A | Oct. 28, 2023, 2:54 p.m. | OK | Python 3 | TESTS | 18 | 46 | 0 | ||
230196956 | sansen | A | Oct. 28, 2023, 2:52 p.m. | OK | Rust 2021 | TESTS | 18 | 15 | 102400 | ||
230207607 | WaterColor2037 | A | Oct. 28, 2023, 3:06 p.m. | OK | Rust 2021 | TESTS | 18 | 31 | 0 |
Back to search problems