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

Автор Alex7, 11 лет назад, По-английски

Hello, please help me find out why my code is getting WA in MTRAIN. My algorithm works this way... 1st BFS from Mirko and mark all edges he can visit. Then start another BFS from Slavko: Slavko can pass a certain edge E1 if there is an Edge E2 which Mriko can pass and the distance between both end points of E1 is <= d. There is a special case that Mirko can't go anywhere and Slavko can travel through edges around them so I calculate the distance between E1 and the starting point of Mirko. Another case is when E1 can be passed while Mirko travels through several edges so if the first test fails I try to do an reversed version where I bfs from Mirko's graph and see if I can reach 2 edges that are close to both end points respectively. Here is my code

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

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

please.. help me