https://nanti.jisuanke.com/t/31720 题意 t组样例,n种船只,q个询问,接下来n行给你每种船只的信息:v[i]表示这个船只的载重,c[i]表示这种船只有2^(c[i]−1)只. 对于每个询问,求用这些船装s的货物的方案数有多少,用到的船必须装满. 分析 一眼就是背包类的题,多重背包求方案数,将数量为m的物体分为log2(m)种物体,然后做01背包.在这里只需改改多重背包模板的转移式子就好. 背包九讲小总结:https://www.cnblogs.com/fht-…
题目链接:https://nanti.jisuanke.com/t/31720 题意:有n种飞船,每种飞船有(1 << c)- 1  艘,容量为 k[i] ,q 次询问,每次询问选若干艘飞船使得容量为 s 的方案数. 题解:预处理出全部情况.dp[ i ][ j ]表示选前 i 个物品凑出容量为 k 的方案数,转移的时候可注意到dp[ i ][ j ] = sigma(dp[i - 1][j - x * v ]),然后减掉不合法的情况(x > ( (1 << c) - 1)…
There are NN different kinds of transport ships on the port. The i^{th}ith kind of ship can carry the weight of V[i]V[i] and the number of the i^{th}ith kind of ship is 2^{C[i]} - 12C[i]−1. How many different schemes there are if you want to use thes…
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poisonous. Every hour, God Water will eat one kind of food among meat, fish and chocolate. If there are 3 c…
这场打得还是比较爽的,但是队友差一点就再过一题,还是难受啊. 每天都有新的难过 A. Magic Mirror Jessie has a magic mirror. Every morning she will ask the mirror: 'Mirror mirror tell me, who is the most beautiful girl in the world?' If the mirror says her name, she will praise the mirror: '…
Jessie and Justin want to participate in e-sports. E-sports contain many games, but they don't know which one to choose, so they use a way to make decisions. They have several boxes of candies, and there are ii candies in the i^{th}ith box, each cand…
God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poisonous. Every hour, God Water will eat one kind of food among meat, fish and chocolate. If there are 33 …
A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young, and was entangled in some mathematical curses. He studied hard until he reached adulthood and decided to use his knowledge to esca…
There are N children in kindergarten. Miss Li bought them NNN candies. To make the process more interesting, Miss Li comes up with the rule: All the children line up according to their student number (1...N), and each time a child is invited, Miss Li…
Bob is a sorcerer. He lives in a cuboid room which has a length of AA, a width of BB and a height of CC, so we represent it as AA * BB * CC. One day, he finds that his room is filled with unknown dark energy. Bob wants to neutralize all the dark ener…