rachitiitr's blog

By rachitiitr, history, 8 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

»
8 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).

»
8 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

  • »
    »
    8 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.