How to Test Input Output with Files for USACO

Viewed 158

Hello I am a new to USACO and I found out that it uses File input and output rather than standard input output on CodeForces. I am used to copying and pasting the input into my ide where the output is then shown to me. I use IntelliJ Java.

This is what happens when I run it

How test input and output through files? Any links or comments would be helpful :) Sorry for being a noob.

1 Answers

You don't have to. when you are testing, just write:

BufferedReader input = new BufferedReader(new InputStreamReader(System.in)));

So that way, you don't have to read the file(and comment out the file reading, remove it when you submit).

And what you did for reading the file was fine.

Related