A cumulative calculation device according to an embodiment is a cumulative calculation device that, with respect to a column v=(v1, ..., vn) of n values divided into groups, calculates cumulation for each of the groups through an associative binary operation. The cumulative calculation device includes: a value conversion unit configured to convert v into v'=(v1', ...., vn') (where vi'=(vi, ci)) when c=(c1, ..., cn) is a column of values in which 1 corresponds to a head element of the group and 0 corresponds to elements other than the head element among elements v1, ..., vn of v; a binary operation generation unit configured to generate a new binary operation for calculating a new pair (p, q) for two pairs (w, x) and (y, z) (where x, z∈{0, 1} using the binary operation; a cumulative calculation unit configured to calculate cumulation si' (where si' is cumulation from v1' to vi' from the new binary operation) by the new binary operation for i=1, ..., n; and an output unit configured to extract a column u=(u1, ..., un) of values indicating the cumulation for said each of the groups from each si' (where i=1, ..., n) and output the extracted u. The new binary operation sets an operation result of w and y by the binary operation to p when z=0, sets y to p when z=1, and sets a logical sum of x and z to q.