Блог пользователя n-m-n

Автор n-m-n, история, 4 года назад, По-английски

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!!

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
4 года назад, скрыть # |
Rev. 4  
Проголосовать: нравится +3 Проголосовать: не нравится

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)