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 1760. Infernal Work

why WA #12
Posted by fermion 13 Mar 2010 18:55
i divide n numbers into ceil[n/a] segments
for each segment, increasing B's ties by add b until it reach a, and count the pairs.

such like this:
while(j + b <= a) {
    ans += j * b;
    j += b;
}
Re: why WA #12
Posted by fermion 13 Mar 2010 19:51
it use %I64d but not %lld