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

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

Here is my solution to SPOJ Problem CHAIN : https://ideone.com/Egu19B

My solution involves maintaining 3 arrays, for containing the root node of each disjoint set as well as the root nodes of predator and prey of that disjoint set. The solution gives a WA, I've verified it for a lot of test cases and am unable to understand why it fails. Can anybody tell me where my solution fails, perhaps even provide me with a test case where it does not work?

The problem : http://www.spoj.com/problems/CHAIN/

Thanks!

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

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by coco_elon (previous revision, new revision, compare).