When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

Angaara's blog

By Angaara, history, 10 months ago, In English

Today, I ran into a completely unique error, while answering the problem A for 875 div. 2. My VS Code has not been working properly, so I searched for an an online C code editor, and there I wrote my code for Problem A Round 875 Div. 2. I got the desired output on the website and submitted my code in the form of .txt file. But Codeforces' compiler didn't accept my submission, as the same code was giving some other output for on the Codeforces' compiler. I didn't find any algorithm related error and the code must've worked fine. So, why did I run into an error at one place and not at the other place?

  • Vote: I like it
  • -5
  • Vote: I do not like it

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Angaara (previous revision, new revision, compare).

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

From what I saw you initialize arrays before you have the value of n.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Then, how should I do that??

  • »
    »
    10 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Initialize them after you get the value of n, or you can just make the number large instead of n depending on the value of n.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

it will good to share the code.