|
|
back to boardwhy 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 |
|
|