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

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

EDIT: Solved. In this problem: 510C - Лиса и имена, I get MLE on test case 12. This is strange as I did not allocate that much space.

My solution: https://pastebin.com/LHY3RiAZ

Data Structures: - 2-D Vector of ints - Stack of ints - Vector of bools to check already visited nodes

Functions: - DFS for topological sort, sorted vertices put in stack - DFS for cycle checking

Is there a memory leak or something? I can't tell.

Thanks, Brad.

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

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

Maybe it's a stack overflow because your DFS enters an infinite loop. Maybe not.