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

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

Hi Experts . I have about to Solve this Simple Floyd Warshall problem . I wrote the Code & Test the Random Inputs & Outputs of uDebug . They are okey for my Code . But I don't know Why I am getting Wrong Answer ??? What is the Critical Points I am missing ?? Please help me in finding out the Critical Points of the Problems ...

=> Problem Link :https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1734&mosmsg=Submission+received+with+ID+16457817

=> My Code : http://ideone.com/ZRGBBr

[ Some Critical Tests and Points are Appreciable ]

Thanks in Advance . Thanks in Advance .

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

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

I don't know exactly what is wrong with your code. I read it and the idea seems correct. Maybe there's something not working as expected in between all those variables and conditionals.

I implemented a similar idea and got accepted. Here is my code for reference, maybe it'll help you: C++ Code

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

    Why did you used here unordered_set??

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

      I always use unordered_set when I don't need the elements to be ordered. Here, I just needed to check how many different elements there were, so unordered_set is the way to go.