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.
Problems
B'You are given three integers a , b and x . Your task is to construct a binary string s of length n = a + b such that there are exactly a zeroes, exactly b ones and exactly x indices i (where 1 <= i < n ) such that s_i ne s_{i + 1} . It is guaranteed that the answer always exists. For example, for the string "01010" there are four indices i such that 1 <= i < n and s_i ne s_{i + 1} ( i = 1, 2, 3, 4 ). For the string "111001" there are two such indices i ( i = 3, 5 ). Recall that binary string is a non-empty sequence of characters where each character is either 0 or 1. The first line of the input contains three integers a , b and x ( 1 <= a, b <= 100, 1 <= x < a + b) . Print only one string s , where s is any binary string satisfying conditions described above. It is guaranteed that the answer always exists. All possible answers for the first example: All possible answers for the second example: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
39924923 |
Potassium |
B |
July 3, 2018, 4:23 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
0 |
|
1300 |
39911914 |
Ulanov_Victor |
B |
July 3, 2018, 3:27 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
0 |
|
1300 |
39904842 |
ndhuy |
B |
July 3, 2018, 3:02 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
0 |
|
1300 |
39903615 |
petr577 |
B |
July 3, 2018, 2:58 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
0 |
|
1300 |
39925399 |
Ahriman |
B |
July 3, 2018, 4:25 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
204800 |
|
1300 |
39920018 |
iEatParrots |
B |
July 3, 2018, 4 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
204800 |
|
1300 |
39916056 |
Goose_with_comp |
B |
July 3, 2018, 3:43 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
204800 |
|
1300 |
39908615 |
1353055672 |
B |
July 3, 2018, 3:15 p.m. |
OK |
FPC |
TESTS |
43 |
31 |
204800 |
|
1300 |
39907463 |
jstimpfle |
B |
July 3, 2018, 3:11 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
0 |
|
1300 |
39901690 |
aniket.shrimal |
B |
July 3, 2018, 2:50 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
0 |
|
1300 |
39926890 |
redfid |
B |
July 3, 2018, 4:31 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39926872 |
1574354102 |
B |
July 3, 2018, 4:31 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39926109 |
zhengfeng_L |
B |
July 3, 2018, 4:28 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39925431 |
sahil99 |
B |
July 3, 2018, 4:25 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39921508 |
rinqh |
B |
July 3, 2018, 4:07 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39918995 |
aas_201098_ |
B |
July 3, 2018, 3:55 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39916879 |
nikhilrajk |
B |
July 3, 2018, 3:47 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39910117 |
AArtur |
B |
July 3, 2018, 3:21 p.m. |
OK |
GNU C |
TESTS |
43 |
31 |
307200 |
|
1300 |
39905662 |
_Z_ |
B |
July 3, 2018, 3:05 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
0 |
|
1300 |
39904919 |
mmestrovic |
B |
July 3, 2018, 3:02 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
0 |
|
1300 |
39904077 |
avaricious |
B |
July 3, 2018, 2:59 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
0 |
|
1300 |
39903221 |
jiang2003 |
B |
July 3, 2018, 2:56 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
0 |
|
1300 |
39902867 |
aaac |
B |
July 3, 2018, 2:55 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
0 |
|
1300 |
39901381 |
shubhu01 |
B |
July 3, 2018, 2:49 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
0 |
|
1300 |
39921853 |
codebreaker33 |
B |
July 3, 2018, 4:08 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
307200 |
|
1300 |
39918489 |
vitoria |
B |
July 3, 2018, 3:53 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
307200 |
|
1300 |
39918287 |
MShafquat |
B |
July 3, 2018, 3:52 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
307200 |
|
1300 |
39916436 |
25gravity |
B |
July 3, 2018, 3:45 p.m. |
OK |
GNU C++ |
TESTS |
43 |
30 |
307200 |
|
1300 |
39908650 |
barrons.guillermo.sal |
B |
July 3, 2018, 3:16 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
0 |
|
1300 |
39907279 |
yctseng |
B |
July 3, 2018, 3:11 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
0 |
|
1300 |
39906337 |
Pratik_07 |
B |
July 3, 2018, 3:07 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
0 |
|
1300 |
39903426 |
pipialvin |
B |
July 3, 2018, 2:57 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
0 |
|
1300 |
39902591 |
andrey_zk |
B |
July 3, 2018, 2:54 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
0 |
|
1300 |
39899405 |
Princ_iple |
B |
July 3, 2018, 2:44 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
0 |
|
1300 |
39926708 |
Chocfudge |
B |
July 3, 2018, 4:30 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
307200 |
|
1300 |
39923779 |
mernazakaria |
B |
July 3, 2018, 4:17 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
307200 |
|
1300 |
39923616 |
papon |
B |
July 3, 2018, 4:17 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
307200 |
|
1300 |
39923608 |
amiable99 |
B |
July 3, 2018, 4:17 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
30 |
307200 |
|
1300 |
39907847 |
ameya |
B |
July 3, 2018, 3:13 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
0 |
|
1300 |
39905193 |
pradeep1999 |
B |
July 3, 2018, 3:03 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
0 |
|
1300 |
39903986 |
NoCodeNoLife |
B |
July 3, 2018, 2:59 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
0 |
|
1300 |
39903581 |
winforbest |
B |
July 3, 2018, 2:58 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
0 |
|
1300 |
39902698 |
arthurkomatsu |
B |
July 3, 2018, 2:54 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
0 |
|
1300 |
39925908 |
modric19 |
B |
July 3, 2018, 4:27 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39924565 |
no_one30 |
B |
July 3, 2018, 4:21 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39914848 |
Rashidov_Anis |
B |
July 3, 2018, 3:39 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39914194 |
ios |
B |
July 3, 2018, 3:36 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39912739 |
hasan_356 |
B |
July 3, 2018, 3:30 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39906373 |
Kirill22 |
B |
July 3, 2018, 3:08 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
15 |
0 |
|
1300 |
39910564 |
baniyacoder |
B |
July 3, 2018, 3:22 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39908771 |
TBlade |
B |
July 3, 2018, 3:16 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39907673 |
0xC0DEF |
B |
July 3, 2018, 3:12 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
15 |
307200 |
|
1300 |
39912634 |
FernandoRicardez |
B |
July 3, 2018, 3:30 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
30 |
0 |
|
1300 |
39912175 |
whquddn55 |
B |
July 3, 2018, 3:28 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
30 |
0 |
|
1300 |
39909470 |
Khaled_Salem |
B |
July 3, 2018, 3:18 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
30 |
0 |
|
1300 |
39908322 |
ben741863140 |
B |
July 3, 2018, 3:15 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
30 |
0 |
|
1300 |
39907584 |
Bittu_09 |
B |
July 3, 2018, 3:12 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
30 |
0 |
|
1300 |
39906763 |
TEAs |
B |
July 3, 2018, 3:09 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
30 |
0 |
|
1300 |
remove filters
Back to search problems