I believe the solution to input #2 for problem 1351C is incorrect.
In input #2, line #58 is "SNWNSENSNNSWNNW". The problem states that each letter "S", "N", "E", "W" should correspond to a direction (south, north, east, west). You move 1m every time, and any time you are at a unique location, it takes five seconds to reach it. It takes only one second to reach a location you have already reached.
For this test case, if you consider the problem using coordinates, starting at (0, 0), you should find: (0, -1) + 5 (0, 0). + 1 // you started there (-1, 0) + 5 (-1, 1) + 5 (-1, 0) + 1 // already been there (0, 0) + 1 (0, 1) + 5 (0, 0) + 1 (0, 1) + 1 (0, 2) + 5 (0, 1) + 1 (-1, 1) + 1 (-1, 2) + 5 (-1, 3) + 5 (-2, 3) + 5
Summing, the total time, t, should be 47. This is the output my program gives. Yet the expected answer is 51.
I tried to "brute force" that one line of that test by forcing my program to print 51 in this specific case. But there were several more instances where I was supposedly off by 4. There have been a couple of accepted solutions, so there is obviously a pattern to these issues. The vast majority, however, have failed this exact test case. Looking at accepted submissions, I have no idea why they work any differently than some of my submissions or other rejected submissions I have looked at. Regardless, by doing this calculation manually, it appears that it is wrong. I am not sure if there's a way to report wrong test cases, but I wanted to share in case someone else has any insights about whether or not the test case is correct.



