Title |
User |
Message |
Date Posted |
Re: Am i doing something wrong |
awaykened |
":" lol //made the same mistake also your algorithm does not print the patterns in the order specifieddsdss "Write a program that prints all bit patterns of length n with k ones in descending order... |
Aug 08, 2014 - 1:21:39 am UTC |
Am i doing something wrong |
LOLWHATOMGBBQ |
I'm pretty sure I'm doing this problem right, can someone help me? |
Aug 08, 2014 - 12:57:20 am UTC |
Re: Re: Any help? |
SourSpinach |
I'm afraid your algorithm just isn't correct (though it does work on some cases, such as small ones). You need to use a concept known as "recursion". |
Nov 08, 2011 - 5:00:48 am UTC |
Re: Re: Any help? |
helios26 |
I'm still getting 0/10 and I tried all of the n, k under 5 and I also checked some bigger nums. I found my error with clearing one of the strings, but nothing else. Any hints? Thanks, ~helios26 |
Nov 08, 2011 - 1:15:23 am UTC |
Re: Any help? |
bbi5291 |
Try some more test cases. Trying all (n,k) with 0 |
Nov 07, 2011 - 1:53:52 am UTC |
Any help? |
helios26 |
What's wrong with my program? I tried it with the test cases and I got them right, but I got wrong answer for it. ~helios26 |
Nov 07, 2011 - 1:29:34 am UTC |
Re: Re: Re: conditions? |
dAedaL |
"You may assume that 30 >= n > 0, 8 > k >= 0, and n >= k" Maybe read the problem statement more carefully next time. |
Jan 08, 2009 - 1:39:56 am UTC |
Re: Re: conditions? |
zhxl0903 |
when k>n |
Jan 08, 2009 - 1:29:41 am UTC |
Re: conditions? |
hansonw1 |
How is that possible? |
Jan 08, 2009 - 1:25:09 am UTC |
conditions? |
zhxl0903 |
do we just output nothing if no patterns fit the given conditions (n and k)? |
Jan 08, 2009 - 1:18:30 am UTC |