rachitiitr's blog

By rachitiitr, history, 9 years ago, In English

Problem Link — E. Train and Statistics
Working on Ideone whereas
RTE on codeforces
Can some help me find out what's the problem here?

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

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

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

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

It gives correct answer, but violates memory somewhere. Also, ans will not fit in int

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Found the problem. I was allocating memory in a wrong way due to the following mistake:

    sz = sz«1;

    instead of

    sz = 1«sz;

    Implemented ST after an year from scratch. Something like this was bound to happen.