Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Yet another problem with DP
Index -> Contests
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MysticVegeta




PostPosted: Sun Apr 23, 2006 5:58 pm   Post subject: (No subject)

wow sweet, it passed all cases, mind explaning a little what you did there? Thanks a bunch!
Sponsor
Sponsor
Sponsor
sponsor
andytyk




PostPosted: Sun Apr 23, 2006 6:13 pm   Post subject: (No subject)

Compare the similarities:

http://www.compsci.ca/v2/viewtopic.php?p=109365&highlight=#109365
MysticVegeta




PostPosted: Sun Apr 23, 2006 6:24 pm   Post subject: (No subject)

yeah that one is pretty easy to understand now when I think about it, thanks to Martin, but I dont get whats going on the if structure in your solution :S
zylum




PostPosted: Sun Apr 23, 2006 10:28 pm   Post subject: (No subject)

thats a nice solution. his arrangement of his for loops is important. it ensures that at each state each number is used at most once. his if statement just checks if the previous state has already been solved.
MysticVegeta




PostPosted: Mon Apr 24, 2006 5:25 pm   Post subject: (No subject)

I see, I used other test case with lower S and arr size and analysed it one-by-one to see what actually is going on. pretty sweet algorithm.
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 20 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: