[ ALERT ] Facebook Hacker CUP 2020 Dates Announced! πŸ‘¨β€πŸ’»

Yeah that was the problem. Now I submitted it successfully. Thanks a lot.

Did not see that coming. :no_mouth:

2 Likes

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?

1 Like

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)

3 Likes

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.

2 Likes

Okay! Seems right.

Same!

1 Like

Yes you are right. :sweat_smile:

@admin Request you to please pin this post so that no one could miss HackerCup 2020.
Thanks

1 Like