PivotOJ

Packing Biscuits

시간 제한: 1000ms메모리 제한: 1024MB출처: IOI 2020BOJ 19936

문제

Aunty Khong is organising a competition with xx participants, and wants to give each participant a bag of biscuits. There are kk different types of biscuits, numbered from 00 to k1k-1. Each biscuit of type ii (0ik10 \leq i \leq k-1) has a tastiness value of 2i2^i. Aunty Khong has a[i]a[i] (possibly zero) biscuits of type ii in her pantry.

Each of Aunty Khong's bags will contain zero or more biscuits of each type. The total number of biscuits of type ii in all the bags must not exceed a[i]a[i]. The sum of tastiness values of all biscuits in a bag is called the total tastiness of the bag.

Help Aunty Khong find out how many different values of yy exist, such that it is possible to pack xx bags of biscuits, each having total tastiness equal to yy

코드를 제출하려면 로그인하세요.