Homework 3

September 26th, 2008

HW3 (LaTeX) is due Oct 4Oct 8, 2008.

23 Responses to “Homework 3”

  1. Mike Says:

    So the post says it is due Oct 4, but the assignment says Oct 8. Do we get to choose?

  2. admin Says:

    my mistake. it’s oct 8

  3. John Meier Says:

    Watch out for type problems if you are getting “wrong answer” on the programming problem.

  4. Brian Matthews Says:

    Please post a link to the UVa problem. I’ve browsed through all 9 volumes for that camel trading problem with no results. I’ve found an explination online, but no place where UVa offers me to submit my solution.

  5. Brian Matthews Says:

    Found it
    http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1641

  6. admin Says:

    Ah ok. the usual format is: if the problem is 10Xxx then it’s in contest volume 10X (written in Roman). And if it’s of the form Xxx, it’s in problem volume X

  7. John Moeller Says:

    I keep getting some kind of redirect error when I try to visit the UVa site.

  8. admin Says:

    Yes, the server currently appears to be down. hopefully it will be back up soon. We are monitoring it (I always wanted to say that :))

  9. Brian Matthews Says:

    Helpful resource:
    http://www.algorithmist.com/index.php/UVa_10700

  10. bomb_the_black_box Says:

    would it be considered cheating if someone posted what is an acceptable 64-bit integer type for C++ that this server will accept is?

    On my windows machine in VS, __64int is working great, but the serve hates this.
    I’ve tried long int, unsigned long int, unsigned long long, unsigned long long int
    and just for fun to offset my frustrations, I also tried:
    unsigned long long long, unsigned long long long long, unsigned long long long long long, unsigned long long long long long long, unsigned long long long long long long long, unsigned long long long long long long long long, unsigned long long long long long long long long long, unsigned long long long long long long long long long long, unsigned long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long
    (not really all of them, but it was fun to type out:)

    please, this searching for data type isn’t aiding in my education, I believe, could be wrong,
    thanks

  11. admin Says:

    Go for it. Any help will be appreciated. On the brighter side, this is the last programming assignment.

  12. bomb_the_black_box Says:

    Good news and bad news (or good, good), thanks all the same.

    Please everyone, if you have the key data type, please o please pass on this golden nugget of knowledge.

    thanks

  13. John Meier Says:

    I just used type “long” in my Java solution and it worked fine.

  14. Mike Says:

    I used “unsigned long long” in c++ and it worked just fine.

  15. killed_the_black_box_||_black_box_killed_me Says:

    Hopefully Helpful,
    Pay attention to the output everyone, that little tinny period is important.

    It may be the difference between several hours,
    a done fool

  16. Trilok Says:

    The programming assignment works fine in my local box with the sample inputs given on the uVa website. But when I submit to uVa, it gives me WA. I’ve used “long” as suggested. Any other help would be appreciated.

    Thanks

  17. Sumner Says:

    For C++, double works fine. Just make sure to use it for your intermediate values as well, then trim off the decimal values in your output. A good test is 20^12.

  18. Dafang Says:

    For question 6.8, shall we assume that the function f() is monotonically ascending? Otherwise, it won’t make sense to wait for more time before opening fire again

  19. admin Says:

    Yes, you can assume that

  20. Dafang Says:

    In fact, a reasonable f() requires an assumption even stronger than the ascending assumption: f(n) should be no smaller than any of the combination f(1)+f(n-1), f(2)+f(n-2), and so on. This assumption means that during a certain period, the machine emits more power in firing once than firing multiple times. Otherwise, this machine doesn’t quite obey the physical law.

    Basically, the assumptions of this problem is very vague. It’s hard to prove the given algorithm works or to design our own algorithms when the problem is not clearly defined. One can always makes some weird assumptions to fail an algorithm, such as some time no robots coming, or f() will become marginally weaker if waiting too much time.

    Hope the lecturer could make a clear set of standards for this problem.

  21. admin Says:

    So I think I was being flippant when I first replied to Dafang. I don’t see why *any* assumption is needed on f. Yes, if it’s not monotonically increasing, this might not make “physical sense”; but who cares ?

    Dafang, can you clarify why you think that any assumption on f is needed, given that the problem input assumes that f is fully specified ?

  22. Jacqueline Says:

    I cannot open the UVa site using my firefox saying that “Firefox has detected that the server is redirecting the request for this address in a way that will never complete.” Does anyone encounter this problem now?

  23. John Moeller Says:

    I get the same thing, and it seems to be permanent on my laptop. I tried removing the cookie for the site and reloading the page, but that didn’t work either. I finally had to just use a different machine.

    It seems to be a case of bad web programming. Which strikes me as a tad ironic. Or maybe it’s just another challenge. :-p

Leave a Reply