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

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

https://cses.fi/problemset/task/1669/ I was solving this problem and my simple approach to detect the cycle is to store the current path in a vector and when i encounter a duplicate in cycle, I print it. But Issue is 3 test cases are giving me WA out of 20. Also test cases are really huge to debug the issue with my code. Any help will be thankful

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

»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Try this case...

4 4

1 2

1 3

3 4

1 4

Hope now you can debug your code yourself :)

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Code similar

It passed all testcase !!