peltorator's blog

By peltorator, 2 days ago, In English

Hi!

Last time I wrote a contest, I got RE1 on a submission that worked on my computer, and you helped me figure out what was wrong. This time I have an even weirder situation. I have CE on a submission that works on my computer. I don't know what's wrong with me. I guess it's a combination of being stupid and being extremely unlucky.

So here is the submission for problem F: 299683526. I submitted it ~10 mins before the end of the contest and got CE. The CE message says something about std::vector but I don't really understand how it is connected to my program. I tried to change some things and even submit with C++23 but it didn't help. After the end of the contest, I learned that a friend of mine had the same issue with problem E. He was able to fix it by submitting with C++17. I then tried to run my code in the "custom invocation" codeforces tab with C++17, and indeed it compiles and works as expected. As my friend had the same problem, this seems to be a bit concerning. Is everything ok with C++20 and C++23 compilers on Codeforces?

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

»
2 days ago, # |
  Vote: I like it -37 Vote: I do not like it

I remember I was getting an error like this once with python. I would get different results on leetcode's version of python vs my local version. It turns out that you were supposed to modify the one of the function parameters in place rather than return a value. So maybe it has something to do with that.

»
2 days ago, # |
  Vote: I like it -70 Vote: I do not like it

can you stop yelling about c++ behaviors

»
2 days ago, # |
  Vote: I like it +8 Vote: I do not like it

Did you try submitting without pragmas?

  • »
    »
    46 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes, indeed. from the other answers I got, it seems to be a compiler bug when using pragmas with vectors. super weird. thanks.

»
47 hours ago, # |
  Vote: I like it +13 Vote: I do not like it

It's a very old problem and I remember it. Check it out