Hi,

Welcome to the Google Code Jam forums!

I have done a lot of programming in Netbeans IDE and I would like to do
> some practice problems in GCJ.


​That's cool.​


> I need some help regarding it. I am able to understand the problem and
> write a code for it but what do I do after that ? What do I do with the .in
> file given to me and how do I use that in Netbeans to get a output file ?


So the way programs typically work is that they take in some input and
produce output. For example, a calculator program takes in a number or
several numbers and produces the desired output, also a number, based on a
sequence of operations performed.

Now assume we're asked to write a program that prints the sum of two
integers. So the input to the program is two integers and the output's an
integer. Assume we were to give it the following pairs of integers as input

1 245
-3 0
22 100

then the corresponding correct output (their sum) would be

246
-3
122

So, to check if someone had written the calculator program correctly, one
way we could test this is to give the above input to their program and
check to see if the correct output's produced.

Indeed, this is what's done in Google Code Jam (and in other programming
competitions): To check if a program is correct, it’s run with valid test
input and the output it produces is checked against the correct output. If
both outputs are identical, then it’s inferred that the program is correct.

To answer your first question on input: The input file is given so that you
can run your program on it (attempting to solve the problem).

For your second question: Assuming you're using Java, you need to be able
to write to a file in that language. It's not specifically tied to
NetBeans, per se. You can look for other examples, but here's a start

https://stackoverflow.com/questions/2885173/how-to-create-a-file-and-write-to-a-file-in-java

So, to recap, you need to be able to read in the input correctly, process
this (solve the problem being asked) and then output the answer as a file.
The file is what you need to submit to the Google Code Jam judge to get a
verdict.

Vinit

- - - - -
Check input and AC output for over *4,350* problems on uDebug
<http://www.udebug.com/>!

Find us on Facebook <https://www.facebook.com/pages/Udebug/1458086424467115>.
Follow us on Twitter <https://twitter.com/uDebug>.​



> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/8a62836f-8571-429a-8808-5fc92ec0101c%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CA%2BXgmOXh9yBJC867XopdayvtoHwyNuE_Y0KfJJGGK-2%3D_bjhRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to