SomeRandomGuy's blog

By SomeRandomGuy, history, 9 years ago, In English

Hi everybody. I was solving this problem, but unfortunately I am getting runtime error. Here is my solution. Any help is appreciated.

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

»
9 years ago, # |
  Vote: I like it +2 Vote: I do not like it
sort(v.begin(), v.end());

    for(ll i = 0; i < n; ++i){

        for(ll j = i - 1; j >= 0; --j){
            if(v[i].w < w || v[i].h < h){
                continue;
            }
            Maximize(i, j);
        }
    }

in

for(ll i = 0; i < v.size(); ++i)

instead of n it should be v.size()