Search found 29 matches

by scruff
Mon Feb 16, 2004 6:36 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 15546

Did your program pass all of the examples given on this board? If so why not try posting your code. If not then try to get it to pass the tests given on this board. The 10 16 10 16 10 one is a good example. It is hard to create an input that can fool your program. It is easier to look at code someti...
by scruff
Fri Feb 13, 2004 5:34 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 15546

why not try this random input generator.

http://people.eecs.ku.edu/~rucker/valladolid/
by scruff
Fri Feb 13, 2004 5:33 pm
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 22165

well sure.... some code would be nice :)
by scruff
Wed Feb 11, 2004 5:16 pm
Forum: Volume 1 (100-199)
Topic: 105 - The Skyline Problem
Replies: 160
Views: 29660

Well, i have a couple of comments. I have not run your code yet but it seems that it always outputs a blank space after every cout which is fine until the last entry and then you should not print the space. This will give a presentation error. The second is what is that last cin in your main() for?
by scruff
Tue Feb 03, 2004 1:51 am
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 15546

Yes this is a correct algorithm for this problem although you have to change it some. The biggest advice I've seen someone give for this problem is to calculate the profits after each exchange and save them in a 3 dimensional table. 2 of the dimensions for the exchange rates and the third dimension ...
by scruff
Sat Jan 31, 2004 7:07 pm
Forum: General
Topic: Test Case Generator and Answer
Replies: 12
Views: 3034

Plasdom: The program creates a random input and creates the solution to that input. I have not gone through and thought of tricky inputs as this takes a while for each problem and I have other things to do. If your program passes one set of inputs then just run the program again to get another set ...
by scruff
Tue Jan 27, 2004 6:49 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 45245

You can also use the search feature and just type in "101" there a quite a few topics already and test data that has tripped up others. Also http://people.eecs.ku.edu/~rucker/valladolid/p101.exe heres a test generator and answer program. It will give an input and give the solution to that input. Jus...
by scruff
Tue Jan 27, 2004 4:59 am
Forum: General
Topic: Test Case Generator and Answer
Replies: 12
Views: 3034

About 25 lines of code and 10 minutes and here is test generator for 105.

http://people.eecs.ku.edu/~rucker/valladolid/p105.exe

Happy Coding!
by scruff
Mon Jan 26, 2004 6:45 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 54692

You've got the right idea with the six different moves, but why not add the moves up with the different bins instead of subtracting from the sum each time. You save some time by eliminating several of your assignment operations sum_tmp=sum. like: [cpp] max[0]=bin[1]+bin[2]+bin[3]+bin[4]+bin[6]+bin[8...
by scruff
Sun Jan 25, 2004 4:22 am
Forum: General
Topic: Test Case Generator and Answer
Replies: 12
Views: 3034

here is the test case generator for problem 104

http://people.eecs.ku.edu/~rucker/valladolid/p104.exe

happy coding.
by scruff
Sat Jan 24, 2004 7:26 pm
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 22165

http://people.eecs.ku.edu/~rucker/valladolid/p103.exe Here is my AC solution. This executable will create a input file and create a solution output file. Just run the input file through your program and double check it against the output file. If you get the same output as the output file then run ...
by scruff
Sat Jan 24, 2004 8:59 am
Forum: Volume 1 (100-199)
Topic: 105 - The Skyline Problem
Replies: 160
Views: 29660

Well, it died with an "invalid memory reference" so check your indexes on your arrays and verify they don't go outside their bounds
by scruff
Sat Jan 24, 2004 12:49 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193466

NSI: It looks like you are using int64 for Rec() to calculate the cycle counts and what not, but you only read in a and b as int I believe that int will hold values -32767 to 32765 or something like that. I can't remember exactly if pascal has unsigned int then this will only hold up to 65535 this ...
by scruff
Sat Jan 24, 2004 12:33 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 45245

I didn't check your code but.... Your code should give you many errors when compiling. You have not included your malloc.h for all of you allocation and deallocation for your dynamic memory. string.h has also been left out from your includes. Maybe you copy and pasted the wrong code but this should'...
by scruff
Sat Jan 24, 2004 12:20 am
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 15546

Ok, your matrix looks like this: 3 1.2 .89 .88 5.1 1.1 0.15 The first line 3 means that you have three countries to trade currencies between. The next line 1.2 .89 means if you have 1 unit of country A$'s currency then you can get 1.2 units of country B$'s currency. Moreover, you can get .89 of coun...

Go to advanced search