Link- SUPW This is my code for SUPW in python-
This is giving accepted for all test cases except for test case 2 in which it is giving Runtime Error. Can someone tell me the reason or provide a test case where it fails. So what I have done is that-
asked 02 Nov '16, 15:51 ![]()
|
The question has been closed for the following reason "The question is answered, right answer was accepted" by mathecodician 18 Mar '17, 19:55
OK, so I finally found the bug. I submitted a solution which was the following- Take the input. That's it. It was still showing error on test-case 2. Then I submitted a solution in which it said that if there's a character which is non numeric and it is not a space then it raises an error and it did on test case 2. So finally I submitted a solution in which it took input in such a way that it did not include alphabetical characters and I got AC. Thanks by the way mz54. I don't have enough karma to upvote else I would have upvoted your help. Here is my solution-
answered 14 Nov '16, 19:47 ![]()
It took about 30-35 submissions.
(14 Nov '16, 20:11)
2
The same thing happened in the problem Wormholes in which the problem was that it said that the next n lines will give the time of the contest but in 2 test cases there were not n lines but less then that so I was taking extra input and again I had to add a try-except block.
(16 Nov '16, 15:02)
Thanks a lot @mathecodician. I had been trying to solve that SUPW problem for months and everytime it gave me error on the second test. Your suggestion to take input in such a way so that it does not include characters other than numbers helped a lot. It finally worked after 30-40 tries!! Thanks a lot! :)
(19 May '17, 20:07)
I am facing same issue in warmholes problem, can you please answer the question on the link below. https://discuss.codechef.com/questions/122165/not-getting-ac-in-warmhole-problem
(04 Feb, 17:16)
|
For Java users, just do the conversion from String to integer inside the try block and also make a catch block to catch the exception. Like this:-
This will work :) answered 19 May '17, 20:10 ![]()
|