Thread: An algorithm for cutting a log into pieces

  1. #16
    Registered User
    Join Date
    Dec 2017
    Posts
    864
    Can you post a link to the original problem? I'd like to see the answer if it's eventually posted.
    The world hangs on a thin thread, and that is the psyche of man. - Carl Jung

  2. #17
    Registered User
    Join Date
    Nov 2019
    Posts
    9
    Quote Originally Posted by john.c View Post
    Can you post a link to the original problem? I'd like to see the answer if it's eventually posted.
    It is a problem regarding school homework but it is not written in english. I only know that the reference solution consists of 6 functions and 92 lines of code and the correct answer for these inputs are:

    (1, 2, 3, 4, 5) - price 33
    (3, 6, 4, 7) - price 40
    (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) - price 44
    (2, 9, 8, 124, 31, 71, 45, 21, 3, 1, 9) - price 849
    (178) - price 0

  3. #18
    Registered User
    Join Date
    Dec 2017
    Posts
    864
    If and when you can, please post the reference solution.
    The world hangs on a thin thread, and that is the psyche of man. - Carl Jung

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to combines differents pieces and form a package
    By sergioms in forum C Programming
    Replies: 9
    Last Post: 09-13-2018, 10:33 AM
  2. joining two pieces of code
    By sean146 in forum C Programming
    Replies: 1
    Last Post: 11-13-2016, 02:26 AM
  3. sending JPGs in pieces?
    By chris24300 in forum C Programming
    Replies: 4
    Last Post: 01-15-2010, 08:04 AM
  4. Are these two pieces of code equivalent?
    By leogoldseed in forum C Programming
    Replies: 7
    Last Post: 09-29-2008, 11:55 PM
  5. keeping track of number of pieces left
    By axon in forum C++ Programming
    Replies: 2
    Last Post: 02-14-2003, 05:55 PM

Tags for this Thread