tag:blogger.com,1999:blog-6294663875929591018.post7055174967711312025..comments2023-09-24T03:12:58.137-07:00Comments on Ramblings of a techie: Google CodeJam 2010 : Theme Park with SolutionBragBoyhttp://www.blogger.com/profile/01173019524783723568noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-6294663875929591018.post-85527475198748499462010-05-17T12:42:24.084-07:002010-05-17T12:42:24.084-07:00@Jamesbond: Is the solution wrong?! Thanks for poi...@Jamesbond: Is the solution wrong?! Thanks for pointing me, Let me check it out right away. Will post the update soon.<br /><br /><b>Edit</b>: Hi Jamesbond, I cross verified the outputs I've uploaded and they seem just fine. If you have a different output please upload, I can tell where you might have gone wrong. Thanks.BragBoyhttps://www.blogger.com/profile/01173019524783723568noreply@blogger.comtag:blogger.com,1999:blog-6294663875929591018.post-542329586532972632010-05-17T10:41:15.562-07:002010-05-17T10:41:15.562-07:00I think your output for both small and large datas...I think your output for both small and large dataset are wrong. It seems correct some first lines but after that, it is not correct.Mr Jamesbondhttps://www.blogger.com/profile/02964159067395139572noreply@blogger.comtag:blogger.com,1999:blog-6294663875929591018.post-30768221536153001382010-05-11T10:03:56.306-07:002010-05-11T10:03:56.306-07:00@Chris: Absolutely. I thought of having an array c...@Chris: Absolutely. I thought of having an array called as visited[] to store whether or not a person is visited or not. However, it was not making a huge difference considering the range of R being 10^8, the probability becomes almost 1 for every group will at least be viewed once.<br />Ideally, your logic is the perfect one.BragBoyhttps://www.blogger.com/profile/01173019524783723568noreply@blogger.comtag:blogger.com,1999:blog-6294663875929591018.post-30283559241388544792010-05-11T09:58:07.141-07:002010-05-11T09:58:07.141-07:00@Hugo, Yes you are correct. I have corrected the c...@Hugo, Yes you are correct. I have corrected the code. Thanks!BragBoyhttps://www.blogger.com/profile/01173019524783723568noreply@blogger.comtag:blogger.com,1999:blog-6294663875929591018.post-10745190795325192982010-05-11T05:46:38.650-07:002010-05-11T05:46:38.650-07:00Thanks for the write up! You inspired me to write...Thanks for the write up! You inspired me to <a href="http://ladro.com/google/" rel="nofollow">write about mine</a>.<br /><br />It is better to look at the code, I just threw together some comments. In a nutshell: you don't have to do anywhere near that many calculations, just keep on adding people to the ride till it is full and repeat till you've seen the same person at the head of the line.<br /><br />Then you know that you can repeat that chunk of users and always get back to the same point. So take the number of rides mod that value to get the number of this supra-grouping you can do.Chris Wilkeshttps://www.blogger.com/profile/10444579894106801070noreply@blogger.comtag:blogger.com,1999:blog-6294663875929591018.post-87936907311840794672010-05-11T04:07:33.212-07:002010-05-11T04:07:33.212-07:00Wouldn't it be a maximum of 10^3 * 10^3 = 10^6...Wouldn't it be a maximum of 10^3 * 10^3 = 10^6 iterations, since the maximum number of groups is 1000?Hugo Peixotohttps://www.blogger.com/profile/07758293504208594743noreply@blogger.com