rebornplusplus's blog

By rebornplusplus, history, 5 years ago, In English

Hello.

Um, I faced an issue during the div 2 round today which I am not sure how to handle. My submission for problem E is getting Compilation Error and showing this message in the following image. It runs okay in my machine and several online workspaces like csacademy, cpp.sh, etc.

Any help would be really appreciated. Submission Link.

  • Vote: I like it
  • +17
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

After careful reading of your code, I found that your code works perfectly with C++17. Link: 49288096

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks. Didn't think to try that out.

    I am still confused though, as to what is the problem with C++11. :/

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      The following slight update to your code was compiled successfully with C++11.

      49301119

      The main update is removing the macros and the user-defined class definition. I wonder if it is reasonable to send such error in a bug report to the GNU project, as it is clear that the mysterious issue that caused it is already resolved in C++17.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
5 years ago, # |
  Vote: I like it +16 Vote: I do not like it

If I remember correctly, it's a compiler bug when you create large pair array inside struct/class. If you add empty constructor it starts working for some reason.

»
5 years ago, # |
  Vote: I like it +15 Vote: I do not like it

Thanks a lot Anachor,CodingKnight and Len.

I added an empty constructor to the SegmentTree class and it worked smooth.