Codeforces Round 979 (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
2030 Codeforces Round 979 (Div. 2) FINISHED False 8100 47058923 Oct. 19, 2024, 2:05 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 23626 ) B Minimise Oneness PROGRAMMING brute force combinatorics constructive algorithms

For an arbitrary binary string (t)(^{\text{∗}}), let (f(t)) be the number of non-empty subsequences(^{\text{†}}) of (t) that contain only (\mathtt{0}), and let (g(t)) be the number of non-empty subsequences of (t) that contain at least one (\mathtt{1}). Note that for (f(t)) and for (g(t)), each subsequence is counted as many times as it appears in (t). E.g., (f(\mathtt{000}) = 7, g(\mathtt{100}) = 4). We define the oneness of the binary string (t) to be (|f(t)-g(t)|), where for an arbitrary integer (z), (|z|) represents the absolute value of (z). You are given a positive integer (n). Find a binary string (s) of length (n) such that its oneness is as small as possible. If there are multiple strings, you can print any of them. (^{\text{∗}})A binary string is a string that only consists of characters (0) and (1). (^{\text{†}})A sequence (a) is a subsequence of a sequence (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) elements. For example, subsequences of (\mathtt{1011101}) are (\mathtt{0}), (\mathtt{1}), (\mathtt{11111}), (\mathtt{0111}), but not (\mathtt{000}) nor (\mathtt{11100}). The first line contains an integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The only line of each test case contains an integer (n) ((1 \leq n \leq 2\cdot10^5)) — the length of (s). It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot10^5). For each test case, output (s) on a new line. If multiple answers exist, output any. In the first test case, for the example output, (f(t)=1) because there is one subsequence that contains only (\mathtt{0}) ((\mathtt{0})), and (g(t)=0) because there are no subsequences that contain at least one (1). The oneness is (|1-0|=1). The output $$$\mathtt{1}

Tutorials

Codeforces Round 979 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
286852713 nikagam B Oct. 19, 2024, 10:05 p.m. OK C# 10 TESTS 4 62 2560000
286838395 loop42 B Oct. 19, 2024, 6:56 p.m. OK C# 10 TESTS 4 265 0
286880018 imritik21 B Oct. 20, 2024, 6:05 a.m. OK C++17 (GCC 7-32) TESTS 5 30 0
286870707 krishna604pk B Oct. 20, 2024, 4:36 a.m. OK C++17 (GCC 7-32) TESTS 5 30 0
286856155 skb231 B Oct. 19, 2024, 11:39 p.m. OK C++17 (GCC 7-32) TESTS 4 30 102400
286855713 nikhilchaturvedi07 B Oct. 19, 2024, 11:24 p.m. OK C++17 (GCC 7-32) TESTS 4 31 0
286859098 klqiqi B Oct. 20, 2024, 1:20 a.m. OK C++17 (GCC 7-32) TESTS 5 31 102400
286834053 _plagiarism_ B Oct. 19, 2024, 6:21 p.m. OK C++17 (GCC 7-32) TESTS 4 31 102400
286879516 Tharun2004 B Oct. 20, 2024, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
286879155 vivek2711 B Oct. 20, 2024, 5:58 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
286878434 chauhanbikash789 B Oct. 20, 2024, 5:52 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
286876058 Aadi2906 B Oct. 20, 2024, 5:33 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
286842385 umang_agg_11 B Oct. 19, 2024, 7:39 p.m. OK C++20 (GCC 13-64) TESTS 4 30 0
286858477 mrysn B Oct. 20, 2024, 1:02 a.m. OK C++20 (GCC 13-64) TESTS 5 30 102400
286857539 36champ B Oct. 20, 2024, 12:31 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
286817789 Mr.Alone B Oct. 19, 2024, 4:18 p.m. OK C++20 (GCC 13-64) TESTS 4 31 0
286877602 chroot_ B Oct. 20, 2024, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 5 31 102400
286852468 enslaved B Oct. 19, 2024, 10:01 p.m. OK C++20 (GCC 13-64) TESTS 4 31 102400
286842903 lzpeye B Oct. 19, 2024, 7:44 p.m. OK C++20 (GCC 13-64) TESTS 4 31 102400
286876589 beiwwen B Oct. 20, 2024, 5:37 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
286876257 chinagty B Oct. 20, 2024, 5:34 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
286875168 Hikarii1903 B Oct. 20, 2024, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
286871784 Amir_Hamza19 B Oct. 20, 2024, 4:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
286866299 prasannads B Oct. 20, 2024, 3:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
286878235 Abdo_Ibrahim7 B Oct. 20, 2024, 5:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 102400
286835049 vudinhlongg B Oct. 19, 2024, 6:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 102400
286873045 chintu_26 B Oct. 20, 2024, 5:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 512000
286879202 _m_k B Oct. 20, 2024, 5:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
286872999 MM756 B Oct. 20, 2024, 5:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
286868320 sskumarcp B Oct. 20, 2024, 4:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
286866290 Fiatiustitia B Oct. 20, 2024, 3:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
286865977 yogeshrathee307 B Oct. 20, 2024, 3:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
286872398 Brackets12 B Oct. 20, 2024, 4:57 a.m. OK FPC TESTS 5 249 0
286874604 YhuanDebeste B Oct. 20, 2024, 5:20 a.m. OK GNU C11 TESTS 5 46 0
286874917 YhuanDebeste B Oct. 20, 2024, 5:23 a.m. OK GNU C11 TESTS 5 61 0
286832672 YhuanDebeste B Oct. 19, 2024, 6:09 p.m. OK GNU C11 TESTS 4 62 0
286826772 sibatullahhosenrafi B Oct. 19, 2024, 5:30 p.m. OK GNU C11 TESTS 4 62 0
286832086 YhuanDebeste B Oct. 19, 2024, 6:05 p.m. OK GNU C11 TESTS 4 77 0
286832293 Salwa_Baki B Oct. 19, 2024, 6:07 p.m. OK GNU C11 TESTS 4 92 204800
286857856 fx_tourist B Oct. 20, 2024, 12:41 a.m. OK GNU C11 TESTS 4 749 0
286862611 iamiftakher46 B Oct. 20, 2024, 2:38 a.m. OK GNU C11 TESTS 5 781 0
286866219 xiongbin B Oct. 20, 2024, 3:37 a.m. OK GNU C11 TESTS 5 811 0
286827825 aarshverma.2006 B Oct. 19, 2024, 5:35 p.m. OK GNU C11 TESTS 4 827 0
286817364 daidao B Oct. 19, 2024, 4:17 p.m. OK Go TESTS 4 61 0
286823861 dineshchandran311 B Oct. 19, 2024, 5:14 p.m. OK Java 21 TESTS 4 202 0
286810643 SherryL B Oct. 19, 2024, 4:01 p.m. OK Java 21 TESTS 4 218 0
286852816 SukeshKumar2 B Oct. 19, 2024, 10:07 p.m. OK Java 21 TESTS 4 218 716800
286843448 PizzaLovers007 B Oct. 19, 2024, 7:50 p.m. OK Java 21 TESTS 4 233 716800
286877813 say_yas B Oct. 20, 2024, 5:47 a.m. OK Java 21 TESTS 5 264 0
286810941 singh.yuvraj1047 B Oct. 19, 2024, 4:02 p.m. OK Java 21 TESTS 4 264 0
286826108 kushalrajpareek1 B Oct. 19, 2024, 5:26 p.m. OK Java 21 TESTS 4 264 204800
286814566 chrisl B Oct. 19, 2024, 4:11 p.m. OK Java 21 TESTS 4 264 409600
286860833 sandesh543 B Oct. 20, 2024, 2:01 a.m. OK Java 21 TESTS 5 264 1228800
286825898 yash11_rai B Oct. 19, 2024, 5:25 p.m. OK Java 21 TESTS 4 265 307200
286844948 ishurajora_23 B Oct. 19, 2024, 8:08 p.m. OK Java 8 TESTS 4 187 0
286837211 Chandan_mehra94 B Oct. 19, 2024, 6:45 p.m. OK Java 8 TESTS 4 187 0
286814231 six-machine B Oct. 19, 2024, 4:10 p.m. OK Java 8 TESTS 4 202 0
286831939 luckyN1 B Oct. 19, 2024, 6:04 p.m. OK Java 8 TESTS 4 218 0
286830634 Soumadip_Mishra B Oct. 19, 2024, 5:54 p.m. OK Java 8 TESTS 4 233 0
286865926 achyut88 B Oct. 20, 2024, 3:33 a.m. OK Java 8 TESTS 5 390 0
286837688 ankeshgupta B Oct. 19, 2024, 6:49 p.m. OK Java 8 TESTS 4 421 0
286879165 2200030476 B Oct. 20, 2024, 5:58 a.m. OK Java 8 TESTS 5 453 0
286811946 mayurkadak B Oct. 19, 2024, 4:05 p.m. OK Java 8 TESTS 4 530 0
286837086 jagbarrameda B Oct. 19, 2024, 6:44 p.m. OK Kotlin 1.9 TESTS 4 171 0
286825740 YhuanDebeste B Oct. 19, 2024, 5:24 p.m. OK Perl TESTS 4 77 0
286875155 BytesizeGenius B Oct. 20, 2024, 5:25 a.m. OK PyPy 3 TESTS 5 155 2764800
286841748 hrayli B Oct. 19, 2024, 7:31 p.m. OK PyPy 3 TESTS 4 171 4608000
286825788 Awsoemio B Oct. 19, 2024, 5:24 p.m. OK PyPy 3 TESTS 4 202 4608000
286826305 Bish311 B Oct. 19, 2024, 5:27 p.m. OK PyPy 3 TESTS 4 218 6041600
286831494 Sovi_11 B Oct. 19, 2024, 6 p.m. OK PyPy 3 TESTS 4 249 4812800
286830883 heet070 B Oct. 19, 2024, 5:56 p.m. OK PyPy 3-64 TESTS 4 78 3276800
286824726 gardengnome B Oct. 19, 2024, 5:18 p.m. OK PyPy 3-64 TESTS 4 92 2867200
286859697 udayan8 B Oct. 20, 2024, 1:36 a.m. OK PyPy 3-64 TESTS 5 92 3072000
286830179 guptaankitaanand B Oct. 19, 2024, 5:51 p.m. OK PyPy 3-64 TESTS 4 92 3584000
286833456 YhuanDebeste B Oct. 19, 2024, 6:16 p.m. OK PyPy 3-64 TESTS 4 93 2867200
286839143 anirudhan_here B Oct. 19, 2024, 7:04 p.m. OK PyPy 3-64 TESTS 4 93 3276800
286845928 AryanGoel575 B Oct. 19, 2024, 8:21 p.m. OK PyPy 3-64 TESTS 4 108 3174400
286868699 redkitex B Oct. 20, 2024, 4:12 a.m. OK PyPy 3-64 TESTS 5 108 4096000
286863473 DivijJ B Oct. 20, 2024, 2:54 a.m. OK PyPy 3-64 TESTS 5 124 3276800
286833890 jvatsal0709 B Oct. 19, 2024, 6:19 p.m. OK PyPy 3-64 TESTS 4 124 3276800
286833144 YhuanDebeste B Oct. 19, 2024, 6:13 p.m. OK Python 2 TESTS 4 155 16588800
286825495 YhuanDebeste B Oct. 19, 2024, 5:22 p.m. OK Python 2 TESTS 4 171 21196800
286829529 MdNazmulHossain B Oct. 19, 2024, 5:46 p.m. OK Python 3 TESTS 4 62 0
286865260 twilight7 B Oct. 20, 2024, 3:23 a.m. OK Python 3 TESTS 5 77 0
286860581 srinandasai12 B Oct. 20, 2024, 1:56 a.m. OK Python 3 TESTS 5 77 0
286850255 slk12slk B Oct. 19, 2024, 9:21 p.m. OK Python 3 TESTS 4 77 0
286829389 sajid982884 B Oct. 19, 2024, 5:45 p.m. OK Python 3 TESTS 4 77 0
286828200 VSS_Sajid B Oct. 19, 2024, 5:37 p.m. OK Python 3 TESTS 4 77 0
286814408 Crackbrain07 B Oct. 19, 2024, 4:11 p.m. OK Python 3 TESTS 4 77 0
286815045 klu_2200080218 B Oct. 19, 2024, 4:12 p.m. OK Python 3 TESTS 4 77 2355200
286832275 avijit204 B Oct. 19, 2024, 6:06 p.m. OK Python 3 TESTS 4 77 3788800
286811063 kishan_18 B Oct. 19, 2024, 4:02 p.m. OK Python 3 TESTS 4 92 0
286873627 hirose2020 B Oct. 20, 2024, 5:11 a.m. OK Ruby 3 TESTS 5 249 1228800
286828452 0x81 B Oct. 19, 2024, 5:39 p.m. OK Rust 2021 TESTS 4 61 102400
286822522 0x81 B Oct. 19, 2024, 5:07 p.m. OK Rust 2021 TESTS 4 108 0

remove filters

Back to search problems