ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1890. Money out of Thin Air

wa3
Posted by Denis 24 Oct 2012 14:01
double check lazy calculations

Edited by author 25.10.2012 03:55
Re: wa3
Posted by die_young 26 Jul 2018 18:45
Had a problem here as well.

In my code I do the following

void apply_push(int64 postponed) {
    sum += (r - l) * postponed;
    lazy += postponed;
}

The following function is called when node range is contained within update range.

And at first I had the following code that caused WA3 which caused same update to be performed several times.

void apply_push(int64 postponed) {
    lazy += postponed;
    sum += (r - l) * lazy;
}
Re: wa3
Posted by die_young 26 Jul 2018 18:45


Edited by author 26.07.2018 18:46