n-m-n's blog

By n-m-n, history, 4 years ago, In English

Hi, I tried submitting solution to this problem: https://mirror.codeforces.com/contest/253/problem/B, in the problem statement it's mentioned to read input and output from the files "input.txt" and "output.txt" respectively, I did the same in my code using these two lines: freeopen("input.txt", "r", stdin); freeopen("output.txt", "w", stdout); But still i'm getting the this error, Here is the link to my submission: https://mirror.codeforces.com/contest/253/submission/135225966, Please help if you know. Thank You!!

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
4 years ago, hide # |
Rev. 4  
Vote: I like it +3 Vote: I do not like it

You do freopen in #ifndef ONLINE_JUDGE block, AFAIK Codeforces defines ONLINE_JUDGE on code compilation, so you should either remove #ifndef block or replace it with #ifdef (the latter in the case you don't want to use input.txt or output.txt locally)