This is a test parser which can automatically parse the tests in from websites like codeforces, codechef, atcoder etc.
- Now with the help of " diff " command track if your output is same as the ouput required by the online Judge
- The only motivation was the existence of competitive companion that could help with getting the tests of a Problem rather than Copy Pasting.
- You should have node.js installed on your local system.
- If not,just download NodeJS from here.
- Competitive companion extension in Browser : download from here.
- Either Fork & Clone this Project or download the codes in your system.( Don't know either refer these Cloning Repo || Downloading Repo
- Go into the file "index.js".
- Press CTRL+F and find and change the "path"(can check Line 9 in code) to the path of your "input.txt" file or any name of your input file.
- Make sure to keep the same name in line no. 28 as well i.e. if your file name is "i" , in line 28, make the first parameter of the function as path + "/i".
- Go into the project directory using the terminal.(use cd commands)
- Type : " npm install " and Press Enter to install all the modules and dependencies of the project.
- Then Run the command : " node index.js " to run the project.
- IMPORTANT : Do not close the terminal. Let it run in background. Otherwise Process Ends.
- Let's say you have a structure of main something like this.
- You have a main fuction from where you call a function that does the rest of work.
- Now you need to app an extra while loop to run it over all the Test Cases.
- Refer the image above
cin >> samples;
while (samples--) {
int t;
cin >> t;
while (t--) {.function call or any code excecution..)
}
It's done you can now continue to think the Logic of the Problem. On Submitting your code to Online-Judge comment out the
cin>>samples;
and you are good to go.