Now I confirmed Cumulative Frequency Tables and ideas of
http://www.chiark.greenend.org.uk/~sgtatham/algorithms/cumulative.htmlpractically having AC 1.37 not very bad because used iostream. Tables better than Fenwick trees because they used
only arrays. For adopting the method I used
formulas a[k]=f(t0,t1,t2,...,tk) where tk=sum of A[i]^k
and is additive contrary to a[k].
During a long time had WA7 because forgotten
that abs does't work in __int64 and
we must build our own abs for __int64.
After cosmetic modifications have 0,843 Ac ant 3-th.
Edited by author 27.09.2007 14:24 Edited by author 27.09.2007 14:31 Edited by author 27.09.2007 14:51 Edited by author 27.09.2007 14:52