Yeah that was the problem. Now I submitted it successfully. Thanks a lot.
Did not see that coming.
Me neither. Didnβt think file name would matter. I did this for first time.
There could be multiple .txt files in your directory. How would it know which file to choose?
Thatβs alright. I do not use freopen()
. I redirect the streams from the terminal. You can do this with:
Compilation:
$ g++ code.cpp -o OUTPUT
$ ./OUTPUT < in > out
Where in
is my input file and out
is my output file. In your case,
$ ./OUTPUT < input.txt > output.txt
(if you do not give -o
during compilation, replace ./OUTPUT
with ./a.out
)
Btw do you know why is source code required when they only check the output file and not the source code? People can even cheat in this way.
Iβm not sure. I guess they only check the output file in practice mode. For the contest, they probably do cross check it with the source later. Iβm guessing they are doing this to reduce the load on the servers? They probably cross check the source only for those who clear that round.
Iβm not entirely sure though. This will be my first hackercup. I started CP very recently.
Okay! Seems right.
Same!
Yes you are right.