Need Help. Trying to submit code for the first time

Hi,
I am try to submit my solution on codechef for the first time but I am observing error with my submission.The code works fine on my machine but it is throwing error on codechef.
My submission- CodeChef: Practical coding for everyone
Kindly help me on this.

Include bank charges given in the problem in your code.

Thanks. Updated that. But I can still see the error in my new submission.
https://www.codechef.com/viewsolution/48032972

I can see the below error while running the code:
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Main.main(Main.java:6)

Try reading the input using BufferedReader or StringTokenizer. Since you code in Java i suggest follow Petr Metrichev input template. Its the easiest to code since you are beginner its best for you

codechef.com/viewsolution/30984245

This code is also giving the same runtime error.

Could you write the error?

You can’t print whatever you want. The question isn’t asking you to print “Insufficient funds” or “Incorrect withdrawal amount”

2 Likes

If you don’t insert any values in custom input and you hit the run button. Then you will get such an error. Runtime Error: NZEC. That’s goo. Simply submit the code.

Use custom input and then error will not be thrown.

Thank you. This resolved the issue.