Codeforces Round 1030 (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
2118 Codeforces Round 1030 (Div. 2) FINISHED False 7200 26666723 June 12, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 29026 ) A Equal Subsequences PROGRAMMING constructive algorithms greedy

We call a bitstring(^{\text{∗}}) perfect if it has the same number of (\mathtt{101}) and (\mathtt{010}) subsequences(^{\text{†}}). Construct a perfect bitstring of length (n) where the number of (\mathtt{1}) characters it contains is exactly (k). It can be proven that the construction is always possible. If there are multiple solutions, output any of them. (^{\text{∗}})A bitstring is a string consisting only of the characters (\mathtt{0}) and (\mathtt{1}). (^{\text{†}})A sequence (a) is a subsequence of a string (b) if (a) can be obtained from (b) by the deletion of several (possibly zero or all) characters. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 500)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1 \le n \le 100), (0 \le k \le n)) — the size of the bitstring and the number of (\mathtt{1}) characters in the bitstring. For each test case, output the constructed bitstring. If there are multiple solutions, output any of them. In the first test case, the number of (\mathtt{101}) and (\mathtt{010}) subsequences is the same, both being (1), and the sequence contains exactly two (\mathtt{1}) characters. In the second test case, the number of (\mathtt{101}) and (\mathtt{010}) subsequences is the same, both being (2), and the sequence contains exactly three (\mathtt{1}) characters. In the third test case, the number of (\mathtt{101}) and (\mathtt{010}) subsequences is the same, both being (0), and the sequence contains exactly five (\mathtt{1}) characters.

Tutorials

Codeforces Round 1030 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324152068 remantadin A June 12, 2025, 6:28 p.m. OK C# 13 TESTS 3 77 0
324144552 og.kostya A June 12, 2025, 5:34 p.m. OK C# 13 TESTS 3 77 0
324191811 _Equinox A June 13, 2025, 4:50 a.m. OK C# 13 TESTS 3 77 204800
324198557 Shashi_S A June 13, 2025, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324191054 ronak_19 A June 13, 2025, 4:41 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324190942 abhishekjhagolu7857 A June 13, 2025, 4:40 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324190802 pooja.leetcoder A June 13, 2025, 4:38 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324189135 Abhay_Pandey7777 A June 13, 2025, 4:19 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324186513 HrsilmalanI A June 13, 2025, 3:45 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324185049 foraccepted A June 13, 2025, 3:26 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324185959 anku__123 A June 13, 2025, 3:38 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324165921 madiyarzm A June 12, 2025, 8:56 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324180701 guineapig25 A June 13, 2025, 2:24 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324193669 satyam1204 A June 13, 2025, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324198007 qidao A June 13, 2025, 5:51 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324197968 Wu_Xin_45 A June 13, 2025, 5:51 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324187443 XtinityDragoon A June 13, 2025, 3:56 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324183352 huanhuanonly A June 13, 2025, 3:02 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324183211 __zamalek__forever__ A June 13, 2025, 3 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324181283 f2021ljh A June 13, 2025, 2:33 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324177958 tarunnnnn A June 13, 2025, 1:40 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324176604 p007kurakula A June 13, 2025, 1:13 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324176312 tarunnnnn A June 13, 2025, 1:07 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324176332 TIGE4 A June 13, 2025, 1:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324173797 Marckess A June 13, 2025, 12:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324175778 JerrySyr A June 13, 2025, 12:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324190186 FurinaHateComma A June 13, 2025, 4:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324184768 kprabhpreet25 A June 13, 2025, 3:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324180343 amanpalariya A June 13, 2025, 2:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324179312 scmc A June 13, 2025, 2:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324178367 harshit936.negi A June 13, 2025, 1:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324178087 jayv.ug22.cs. A June 13, 2025, 1:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324177631 kaizen_01 A June 13, 2025, 1:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324131492 James_bond_9089 A June 12, 2025, 4:27 p.m. OK C# 8 TESTS 3 93 204800
324179750 bluemegane A June 13, 2025, 2:09 a.m. OK C# 8 TESTS 3 124 409600
324146535 ruban A June 12, 2025, 5:47 p.m. OK FPC TESTS 3 77 61952000
324147517 Manish_5076 A June 12, 2025, 5:54 p.m. OK GNU C11 TESTS 3 30 102400
324144925 Power_4999 A June 12, 2025, 5:37 p.m. OK GNU C11 TESTS 3 31 0
324179673 IseriNina27 A June 13, 2025, 2:08 a.m. OK GNU C11 TESTS 3 31 0
324187739 basically_deceased A June 13, 2025, 4 a.m. OK GNU C11 TESTS 3 140 0
324156011 Imran_Hossain_Nadvy A June 12, 2025, 6:54 p.m. OK GNU C11 TESTS 3 140 0
324160823 Geniusthinker A June 12, 2025, 7:48 p.m. OK GNU C11 TESTS 3 140 102400
324190587 Noaaa A June 13, 2025, 4:35 a.m. OK GNU C11 TESTS 3 140 102400
324191092 Cima16 A June 13, 2025, 4:42 a.m. OK GNU C11 TESTS 3 155 102400
324146870 kbspirit A June 12, 2025, 5:49 p.m. OK GNU C11 TESTS 3 156 102400
324142989 jssiza A June 12, 2025, 5:25 p.m. OK GNU C11 TESTS 3 171 0
324178566 dragon_slayer875 A June 13, 2025, 1:50 a.m. OK Go TESTS 3 30 1536000
324156193 IvanDimovSIT A June 12, 2025, 6:56 p.m. OK Haskell TESTS 3 61 0
324186675 keshav_.agg A June 13, 2025, 3:47 a.m. OK Java 21 TESTS 3 171 102400
324190116 HarhsSoni A June 13, 2025, 4:31 a.m. OK Java 21 TESTS 3 187 0
324147273 Kavi965 A June 12, 2025, 5:52 p.m. OK Java 21 TESTS 3 187 102400
324187652 NpHardcore_05 A June 13, 2025, 3:59 a.m. OK Java 21 TESTS 3 187 307200
324184420 Diptarshi A June 13, 2025, 3:17 a.m. OK Java 21 TESTS 3 202 0
324144706 This_Is_Amazing A June 12, 2025, 5:35 p.m. OK Java 21 TESTS 3 202 0
324199057 Aryaman__001 A June 13, 2025, 6:01 a.m. OK Java 21 TESTS 3 202 204800
324189459 sunil_singh A June 13, 2025, 4:23 a.m. OK Java 21 TESTS 3 202 307200
324194420 tirean A June 13, 2025, 5:15 a.m. OK Java 21 TESTS 3 202 614400
324152114 yashjaiswal2509 A June 12, 2025, 6:28 p.m. OK Java 21 TESTS 3 202 819200
324185987 cai_lian_2023 A June 13, 2025, 3:38 a.m. OK Java 8 TESTS 3 108 0
324133790 code2code A June 12, 2025, 4:31 p.m. OK Java 8 TESTS 3 140 0
324149440 veeresh_04 A June 12, 2025, 6:08 p.m. OK Java 8 TESTS 3 155 0
324196429 codexzx A June 13, 2025, 5:36 a.m. OK Java 8 TESTS 3 155 0
324155919 jroy.karnati A June 12, 2025, 6:53 p.m. OK Java 8 TESTS 3 155 0
324151164 krishnandu01 A June 12, 2025, 6:21 p.m. OK Java 8 TESTS 3 155 0
324143987 anishpati1 A June 12, 2025, 5:31 p.m. OK Java 8 TESTS 3 155 0
324189718 phoenix_beast117 A June 13, 2025, 4:26 a.m. OK Java 8 TESTS 3 171 0
324131040 itsabhishek5678 A June 12, 2025, 4:26 p.m. OK Java 8 TESTS 3 187 0
324147176 priya91 A June 12, 2025, 5:51 p.m. OK Java 8 TESTS 3 202 0
324143287 Seif_Shaheen A June 12, 2025, 5:27 p.m. OK Kotlin 1.9 TESTS 3 186 307200
324156440 L-S-S A June 12, 2025, 6:59 p.m. OK Kotlin 1.9 TESTS 3 202 307200
324146763 illibio A June 12, 2025, 5:48 p.m. OK Node.js TESTS 3 124 2355200
324190052 khushi_1411 A June 13, 2025, 4:30 a.m. OK PyPy 3 TESTS 3 108 204800
324143001 Mr.Beast192 A June 12, 2025, 5:25 p.m. OK PyPy 3 TESTS 3 108 1638400
324194186 non_geniosity A June 13, 2025, 5:13 a.m. OK PyPy 3 TESTS 3 108 1740800
324158064 adem1234 A June 12, 2025, 7:16 p.m. OK PyPy 3 TESTS 3 171 5529600
324165066 alexwice A June 12, 2025, 8:44 p.m. OK PyPy 3-64 TESTS 3 62 204800
324165862 lakshyamehta03 A June 12, 2025, 8:55 p.m. OK PyPy 3-64 TESTS 3 62 1331200
324181934 hxu10 A June 13, 2025, 2:42 a.m. OK PyPy 3-64 TESTS 3 77 0
324158357 gardengnome A June 12, 2025, 7:19 p.m. OK PyPy 3-64 TESTS 3 77 0
324193331 sahudebankumar A June 13, 2025, 5:05 a.m. OK PyPy 3-64 TESTS 3 77 921600
324147389 Deemo_ML A June 12, 2025, 5:53 p.m. OK PyPy 3-64 TESTS 3 77 1126400
324199136 ivin43 A June 13, 2025, 6:02 a.m. OK PyPy 3-64 TESTS 3 77 1331200
324188478 K_alpha-genZ A June 13, 2025, 4:10 a.m. OK PyPy 3-64 TESTS 3 77 1331200
324182519 HtKE A June 13, 2025, 2:50 a.m. OK PyPy 3-64 TESTS 3 77 1331200
324163568 venkat2912 A June 12, 2025, 8:23 p.m. OK PyPy 3-64 TESTS 3 77 1331200
324140960 klu230003812 A June 12, 2025, 5:14 p.m. OK Python 2 TESTS 3 77 0
324196966 SaurabhS97 A June 13, 2025, 5:41 a.m. OK Python 3 TESTS 3 46 204800
324173881 EmilioR400 A June 13, 2025, 12:08 a.m. OK Python 3 TESTS 3 46 204800
324146891 Georgy_Hryashev A June 12, 2025, 5:49 p.m. OK Python 3 TESTS 3 61 0
324162200 patrapadra A June 12, 2025, 8:06 p.m. OK Python 3 TESTS 3 61 204800
324156209 Suryansh0910 A June 12, 2025, 6:56 p.m. OK Python 3 TESTS 3 61 204800
324144905 crazy_bitch_03 A June 12, 2025, 5:37 p.m. OK Python 3 TESTS 3 61 204800
324197868 pet_pooja A June 13, 2025, 5:50 a.m. OK Python 3 TESTS 3 62 0
324149629 rishabhdwivedi.234ca043 A June 12, 2025, 6:09 p.m. OK Python 3 TESTS 3 62 0
324144351 Sin_R0str0 A June 12, 2025, 5:33 p.m. OK Python 3 TESTS 3 62 0
324144313 prashant24816gp A June 12, 2025, 5:33 p.m. OK Python 3 TESTS 3 62 0
324133914 prudentissimus A June 12, 2025, 4:31 p.m. OK Rust 2021 TESTS 3 31 0
324183278 BetterThanNobita A June 13, 2025, 3:01 a.m. OK Rust 2021 TESTS 3 46 0
324143292 sousou_no_frieren A June 12, 2025, 5:27 p.m. OK Rust 2021 TESTS 3 46 0

remove filters

Back to search problems