bittorrent.com
Solve this challenge. It is necessary for our main development work (bundling adware, adding adverstisements, slowly but surely ruining Ludvig's glorious code base).
BitTorrent creates advanced, innovative technologies to efficiently move large files across the Internet.
Actually, BitTorrent lives off its good name, and its business model is basically leeching off suckers who don't know any better.
A more appropriate challenge would be: How would you obfuscate the bundled software offers so they get installed onto more unsuspecting people's computers?
You have 40 bowls, all placed in a line at exact intervals of 1 meter. You also have 9 oranges. You wish to place all the oranges in the bowls, no more than one orange in each bowl, so that there are no three oranges A, B, and C such that the distance between A and B is equal to the distance between B and C. How many ways can you arrange the oranges in the bowls?.
>>10
Oh crap, I read it too fast, >>8 is wrong. Easy to fix but will cost some speed. I leave it as an exercise to the reader.
Name:
Anonymous2011-05-24 18:40
>>10
If you were to make a table of the distances between all of the oranges, none of the numbers would be the same (excepting the distance from A to B being the same as the distance from B to A.)
This is how mathematicians and computer scientists actually write and speak.
Name:
Mathematician2011-05-24 18:50
computer scientists
Don't try to get on my level (aka GOD TIER fags), CS fucktards. You just can't.
Man. Quote pyramids look totally rad with my custom /prog/ userstyle. Totally rad.
Name:
Anonymous2011-05-24 19:55
>>18
ur just jelly cuz u cant go past 4 nests lmao
Name:
Anonymous2011-05-24 20:00
>>9
How is using bitvectors a disqualification? You know nothing of computing.
Name:
Anonymous2011-05-24 20:09
>>20
It's not enterprise. You want to work in a company, right? First off, you should be using Java. Second, no tricky bits. All code must be self-documenting (identifiers should have at least 20 characters), and each line should be explained by two lines of comments. Finally, prepare your anus.
This is about 22% slower, ergo be careful with bitfields. Using ints instead of chars has about the same speed impact.
With an instrumented build I see that the original version memcpy()s a bit over 16GiB, and the modified version accesses bit arrays about 2490 million times. So copying 6 bytes is faster than two shifts and a bitwise op. Kind of makes sense in retrospect.
Name:
Anonymous2011-05-24 21:53
Do you really need to write a program for this? BitTorrent devs don't know combinatorics?
The total number of arrangements is C(40,9). We wish to exclude any arrangement with 3 equidistant items. Subtract the total number of arrangements from the number of all arrangements with at least 1 set of 3 equidistant items. Pick any set of 3 equidistant items. Then there are C(37,6) ways to arrange the rest of them.
The rest of this problem is left as an exercise for the reader.
>>30
No, the output is supposed to look like a single number. It looks like you modified it individual solutions. I do not see anything wrong with them though. Tell me which one doesn't have nine oranges, or find me three oranges A, B, and C within a solution such that the distance between A and B is equal to the distance between B and C. Otherwise tell me what seems wrong to you.
This visits 30% less nodes (40568992 vs 57820588) but is less than 10% faster. I'm not sure heuristically stopping more searches earlier would be a worthwhile gain. I had another idea to speed it up but I forgot. In any case it should run in under 10 seconds in any decent modern computer.
This is pointless, this damn thing just won't go much faster. Still waiting for that combinatorial solution, but I guess the mathematicians are satisfied just proving one exists.
>>36
Okay cockmaster buttrange, put some different fucking numbers in. It's a combinatorics problem, the hamfisted ways in other solutions are just overcomplications.