cosmos123's blog

By cosmos123, history, 2 years ago, In English

I got error after submitting solution. Error:- Can't find file output.txt invokerId=89b28bde0e3e846b39c95274a38bedb0, location=203279212.

Link for my submission: https://codeforces.net/contest/120/submission/169547665 Can somebody explain me why this error is occurring??

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

| Write comment?
»
2 years ago, # |
  Vote: I like it +21 Vote: I do not like it

Use

ifstream fin("input.txt");
ofstream fout("output.txt");

instead of cin/cout.

  • »
    »
    2 years ago, # ^ |
    Rev. 2   Vote: I like it +17 Vote: I do not like it

    Alternatively use

    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    

    and work with cin/cout as normal. These seem to be about equally fast iirc?