Блог пользователя s1d_3

Автор s1d_3, история, 9 лет назад, По-английски

This is a pretty common problem: http://www.spoj.com/problems/CLEANRBT/

The common solution to this is finding shortest paths among all dirty tiles, and then doing a TSP on these.

I thought about another method, actually before the above even came to my head. This is much more simpler, though takes way way more space as well as time from the first approach. However, it still fits in with the requirements of the problem, hence, I went ahead and implemented it, for the sake of it: https://ideone.com/JXlzZY

It's passing all the given test cases, as well as some which I tried myself. But I keep getting a WA on submission. Any help on this would be much appreciated.

My algo would seem pretty straight-forward from the code I posted above, but I am still going ahead to outline the particulars: I maintain a dp table corresponding to the room, and a bitmask for every such tile. So dp[i][j][mask] would have the value of reducing mask to (1<<numberOfDirtyTiles — 1), with my source as (i, j).

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор s1d_3, история, 9 лет назад, По-английски

Could we change the time of the event please? There are a large number of us who do both of them. This is the first time I see a clash.

I posted a similar post in codechef as well: https://discuss.codechef.com/questions/75130/september-cook-off-clashing-with-codeforces-round-321

But Codechef has been hosting the cookoff at the same time for the last few years. It doesn't make sense for them to change it.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится