IGrenadiers's blog

By IGrenadiers, history, 5 weeks ago, In English

The contest held on 20th September 2021 , Educational Round 114 , Division 2 20:05 UTC+5:30 had a serious compiler issue I was solving problem C Educational Round 114 Div 2 Problem C , and I had the following code for it :

My Code

Codeblocks Compiler and ideone.com show the same output and the correct answer for the sample testcase but the codeforces for some reason calculates lower bound of 4 to be 6 ? Since I might be wrong that's why I would be glad if someone could confirm this thank you.

MikeMirzayanov can you look into this for once please ? its been multiple times this has happened not in contest but practice submissions as well

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

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

full sumport veeru

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

Maybe some undefine behaviour? I have this once when I use getchar

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

    you can check the code mate there is no getchar and this thing has happened with me even before and now its way more tilting and irritating

»
5 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

I am not sure about the lower bound issue, but if idx=v.size()-1 then it might cause some problem as you are accessing v[idx+1] too

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

    I did add the if condition but still for some reason it picks the lower bound as 6 like what ?

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Your if condition is for idx=v.size()

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

        yeah that's for out of bounds I know , and even when I added the condition if(idx<v.size()-1) then check for idx+1 , even in that case , the compiler picks 6 as lower bound and I really don't know how codeblocks and ideone.com are some how giving correct answers

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

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