tag:blogger.com,1999:blog-29632375.post5472104956822832018..comments2023-06-19T19:45:40.281-07:00Comments on vexorian's blog: SRM 581: Did I solve the 500?Unknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-29632375.post-90841476810384874172013-06-03T23:21:15.297-07:002013-06-03T23:21:15.297-07:00Or a even simpler approach, since N is only 300, y...Or a even simpler approach, since N is only 300, you could you N DFS to do that.lxfindnoreply@blogger.comtag:blogger.com,1999:blog-29632375.post-78362842285534882472013-06-03T21:05:29.854-07:002013-06-03T21:05:29.854-07:00"The last complication of the problem is to c..."The last complication of the problem is to count the number of fragments of each length. This requires dynamic programming and was actually the thing that took me (by far) the most time to think of and code."<br /><br /><br />This is easy if you run Floyd Warshall on the trees first (I know it's an overkill :P).anujtempnoreply@blogger.com