noobboyyyy's blog

By noobboyyyy, history, 3 years ago, In English

Can anybody help me to figure out the reason why getting TLE DESPITE USING DFS Iterative Version Problem : https://cses.fi/problemset/task/1666/ My Solution :https://cses.fi/problemset/result/1699864/ It will be great if you can point out

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

something is wrong with the judge, I did an iterative dfs version and it fails with TLE.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    judge is ok, just resubmitted my solution and passed without any problems, you either have infinite loop or just something very slow

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      are you using Java? could you share your solution in Java if you don't mind

»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

use a DSU (https://cses.fi/paste/ad7ee952ea5aaab613b947/)

i cannot see your submission :/ (click "Share code to others" on your result page)