题意: 从n个数里选出m个来,还要使得这m个数之和被d整除. 给一个n和q,再给n个数,再给q个询问,每个询问包含两个数,d,m; 对于每个case输出每个q个询问的可行的方案数. 思路: 每个数只能被取一次 那我直接dp一下,dp[i][j]直接代表前i个物品有j值: 然后j这个值由2^31*200-这就不行了... 虽然可以/d 变变变!!! 但是我们可以把余数开一维啊,然后还是前i个物品开一维,但是还有选几个再开一维,那就开三维了... 01背包开两维反着更新一下就好了. dp[i][j]…