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…
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…
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…
Now you have a string consists of uppercase letters, two integers AA and BB. We call a substring wonderful substring when the times it appears in that string is between AA and BB (A \le times \le BA≤times≤B). Can you calculate the number of wonderful…
There are NN children in kindergarten. Miss Li bought them NN 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)(1...N), and each time a child is invited,…
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)…
题目链接: https://nanti.jisuanke.com/t/31452 AC代码(看到不好推的定理就先打表!!!!): #include<bits/stdc++.h> using namespace std; # define maxn 40000+100 int a[maxn]; int b[maxn]; int ans=0; char s[1000]; int c[maxn]; int ti=0; void f() { memset(c,0,sizeof(c)); memset(…