[–] imaginenore 11y ago ↗ I'm stuck on the pancake problem. I can't find the error in my output.Input: http://paste.ofcode.org/VQvSyq2bF8SCxxRu2uSjguOutput: http://paste.ofcode.org/LKpMbPCd4S7wGfDRzugg6nCan anybody please run it through your solution and tell me where my output is wrong? [–] bavetta 11y ago ↗ I am getting exactly the same output as you for that input and I also am having trouble finding an error. [–] imaginenore 11y ago ↗ I really hope it's not some formatting bullshit like a newline at the end.EDIT:I just tried again without a blank line at the end, and still got INCORRECT.Second attempt data:Input: http://paste.ofcode.org/jCNBZw6vPJT7ryZA4GUziMMy incorrect output: http://paste.ofcode.org/eNx74e35rqF54Uvm5bRa8K [–] okuli 11y ago ↗ Ran both your inputs and get exactly the same results, also can't figure out where's the error. Apparently there's some edge case when you should use different strategy than splitting it in 2 equal piles. [–] imaginenore 11y ago ↗ Finally solved it. Apparently splitting in half isn't always the optimal step, sometimes you have to move a different amount.Example:9 3 36 3 3 33 3 3 3 32 2 2 2 21 1 1 1 1
[–] bavetta 11y ago ↗ I am getting exactly the same output as you for that input and I also am having trouble finding an error. [–] imaginenore 11y ago ↗ I really hope it's not some formatting bullshit like a newline at the end.EDIT:I just tried again without a blank line at the end, and still got INCORRECT.Second attempt data:Input: http://paste.ofcode.org/jCNBZw6vPJT7ryZA4GUziMMy incorrect output: http://paste.ofcode.org/eNx74e35rqF54Uvm5bRa8K [–] okuli 11y ago ↗ Ran both your inputs and get exactly the same results, also can't figure out where's the error. Apparently there's some edge case when you should use different strategy than splitting it in 2 equal piles. [–] imaginenore 11y ago ↗ Finally solved it. Apparently splitting in half isn't always the optimal step, sometimes you have to move a different amount.Example:9 3 36 3 3 33 3 3 3 32 2 2 2 21 1 1 1 1
[–] imaginenore 11y ago ↗ I really hope it's not some formatting bullshit like a newline at the end.EDIT:I just tried again without a blank line at the end, and still got INCORRECT.Second attempt data:Input: http://paste.ofcode.org/jCNBZw6vPJT7ryZA4GUziMMy incorrect output: http://paste.ofcode.org/eNx74e35rqF54Uvm5bRa8K [–] okuli 11y ago ↗ Ran both your inputs and get exactly the same results, also can't figure out where's the error. Apparently there's some edge case when you should use different strategy than splitting it in 2 equal piles. [–] imaginenore 11y ago ↗ Finally solved it. Apparently splitting in half isn't always the optimal step, sometimes you have to move a different amount.Example:9 3 36 3 3 33 3 3 3 32 2 2 2 21 1 1 1 1
[–] okuli 11y ago ↗ Ran both your inputs and get exactly the same results, also can't figure out where's the error. Apparently there's some edge case when you should use different strategy than splitting it in 2 equal piles. [–] imaginenore 11y ago ↗ Finally solved it. Apparently splitting in half isn't always the optimal step, sometimes you have to move a different amount.Example:9 3 36 3 3 33 3 3 3 32 2 2 2 21 1 1 1 1
[–] imaginenore 11y ago ↗ Finally solved it. Apparently splitting in half isn't always the optimal step, sometimes you have to move a different amount.Example:9 3 36 3 3 33 3 3 3 32 2 2 2 21 1 1 1 1
5 comments
[ 3.1 ms ] story [ 17.9 ms ] threadInput: http://paste.ofcode.org/VQvSyq2bF8SCxxRu2uSjgu
Output: http://paste.ofcode.org/LKpMbPCd4S7wGfDRzugg6n
Can anybody please run it through your solution and tell me where my output is wrong?
EDIT:
I just tried again without a blank line at the end, and still got INCORRECT.
Second attempt data:
Input: http://paste.ofcode.org/jCNBZw6vPJT7ryZA4GUziM
My incorrect output: http://paste.ofcode.org/eNx74e35rqF54Uvm5bRa8K
Example:
9 3 3
6 3 3 3
3 3 3 3 3
2 2 2 2 2
1 1 1 1 1