题解列表

筛选

多重背包 动态规划

```cpp#includeusingnamespacestd;constintL=5000+50;intn,m;intv[L],w[L],q[L];intdp[L][L];intmain(){scanf("%d%d",&n,&m);for(inti=1;i

完全背包问题,动态规划!!

其实和01背包问题差别不大,01背包每件物品只能选一个,多重背包每件物品在不超过背包体积的条件下可以选择无限个!```cpp#includeusingnamespacestd;constintL=5000+50;intn,m;intv[L],

01背包问题 动态规划

```cpp#includeusingnamespacestd;constintL=5000+50;intn,m;intv[L],w[L];intdp[L][L];intmain(){scanf("%d%d",&m,&n);for(inti=1;i

01背包问题!!!

```cpp#includeusingnamespacestd;constintL=5001;intn,m;intv[L],w[L];intdp[L][L];intmain(){scanf("%d%d",&n,&m);for(inti=1;i

编写题解 2074: [STL训练]A+B

摘要:解题思路:注意事项:参考代码:while True:     try:         a,b=map(str,input().split())         print(int(a.repl……

HashMap的应用

摘要:解题思路:利用hashmap键值对 ,判断键是否存在对应的字符 ,不存在则初始化,值为1,表示第一次出现;存在的话值加一;最后遍历输出。注意事项:  map.containsKey()判断键是否存在;……

简单遍历解决

摘要:解题思路:即寻找两正整数a,b最大无法组合的数。已知a*b一定可以被组合,从a*b开始往小搜索即可。注意事项:参考代码:#include<iostream>using namespace std;in……

明明的随机数——C语言代码

####解题思路先去重,再排序####注意事项去重时下标要后退一位,防止三个重复数字!!!-####代码如下```c#includeintmain(){intn;inta[100];inti,j;scanf("%d",&n);for(i=0;i

编写题解 2073: [STL训练]亲和串

摘要:解题思路:注意事项:参考代码:while True:     try:         a=input().strip()         b=input().strip()         ……

Python斐波拉契---本题python无解

摘要:解题思路:   事先说明,本题还没有其他人提供python解法,我也没能解决,这个参考代码不能正确通过题目。                  本题有以下几个难点需要解决:            &nbs