Ad
  • Custom User Avatar

    I was having the same problem, it turned out to be when the vector is empty and we subtract 1 from its size, the comparison in the for loop doesn't work as we expect because v.size() returns an unsigned, and the result of 0 - 1 ends up beign a big positive number instead of -1

    Oh man, I love c++ hahah

  • Custom User Avatar

    So I guess I'm missing how to create the sensors database for the agent, and how to query it properly.

  • Custom User Avatar

    Hey guys, can someone give me a hint on this one? I've been trying it for quite some time.
    I'm using a BFS, but at this point I'm not quite sure if this is a good approach. A DFS would be any better?

    Edit: scrolling down I saw my old post, from 6 months ago, hahah wow

  • Custom User Avatar

    Lol, ty

    I completely missed the point, I know that he can reach the gold, but the agent itself doen't know the entire layout of the map.

  • Custom User Avatar

    -P--

    -W--

    --G-

    ----


    -P--

    ----

    ----

    -GW-

    Could someone please explain to me why these should be false? Can't the agent get to the gold safely?

  • Custom User Avatar

    Can you elaborate more on this, please? I'm getting the same error

  • Custom User Avatar

    Solved, idk why but the problem was that I was using vector reserve.

  • Custom User Avatar

    This doesn't make any sense, are the matrices being converted to a string when checking the test cases?
    They should compare equal, given that all numbers match, independently of these weird spaces.

  • Custom User Avatar
  • Custom User Avatar

    It looks like this without the [

           1,           2,           3 ],
           8,           9,           4 ],
           7,           6,           5 ]
    
  • Custom User Avatar

    Hi everyone, I am getting this strange behavior:

    Expected: equal to [
    [ 1, 2, 3 ],
    [ 8, 9, 4 ],
    [ 7, 6, 5 ]
    ]
    Actual: [
    [ 1, 2, 3 ],
    [ 8, 9, 4 ],
    [ 7, 6, 5 ]
    ]

    Does anyone know why my solution has those spaces before the numbers? Ty

    PS.: They don't actually show up when I publish the comment.

  • Custom User Avatar

    Seeing this I feel very embarrassed for my solution hahaha
    Nice job man