当前位置: 首页 > news >正文

网站动态图标兰州seo优化入门

网站动态图标,兰州seo优化入门,长沙网站seo价格,做推广网站费用1. #include<bits/stdc.h> using namespace std; //一个记录小猫的重量&#xff0c;sum记录当前小猫的重量之和 int n, w, a[3000],sum[3000],ans; bool cmp(int a,int b) {return a > b; } //x表示小猫当前的编号&#xff0c;cnt表示缆车的数量 void dfs(int x,int …

1.

#include<bits/stdc++.h>
using namespace std;
//一个记录小猫的重量,sum记录当前小猫的重量之和
int n, w, a[3000],sum[3000],ans;
bool cmp(int a,int b) {return a > b;
}
//x表示小猫当前的编号,cnt表示缆车的数量
void dfs(int x,int cnt) {if (cnt >= ans)return;if (x == n + 1)ans = cnt;ans = min(ans, cnt);for (int i = 1; i <= cnt; i++) {if (a[x]+sum[i]<=w) {sum[i] += a[x];dfs(x+1,cnt);sum[i] -= a[x];}//超出w,开启下一辆车sum[cnt+1] = a[x];dfs(x + 1, cnt+1);sum[cnt+1] = 0;}
}
int main() {cin >> n >> w;ans = n;for (int i = 1; i <= n; i++) {cin >> a[i];}sort(a+1,a+n+1,cmp);dfs(1,1);cout << ans;return 0;
}

2.

#include<bits/stdc++.h>
using namespace std;
int n,w,ans,sum[2000],p[2000];
bool cmp(int a,int b){return a>b;
}
void dfs(int u,int k){if(k>=ans) return ;//剪枝if(u==n+1) ans=k;//记录答案for(int i=1;i<=k;i++){if(sum[i]+p[u]<=w){sum[i]+=p[u];dfs(u+1,k);sum[i]-=p[u];}}sum[k+1]=p[u];dfs(u+1,k+1);//多使用一个缆车sum[k+1]=0;
}
int main(){cin>>n>>w;ans=n;for(int i=1;i<=n;i++) cin>>p[i];//sort(p+1,p+1+n,cmp);//可以不使用排序dfs(1,1);cout<<ans;return 0;
}


文章转载自:
http://tropotaxis.bbtn.cn
http://submaster.bbtn.cn
http://signatureless.bbtn.cn
http://snailfish.bbtn.cn
http://lamentedly.bbtn.cn
http://woodcarver.bbtn.cn
http://landscapist.bbtn.cn
http://hospitalize.bbtn.cn
http://swoose.bbtn.cn
http://windstick.bbtn.cn
http://whipgraft.bbtn.cn
http://pintle.bbtn.cn
http://subinfeudation.bbtn.cn
http://warrison.bbtn.cn
http://pentagonal.bbtn.cn
http://quantize.bbtn.cn
http://unrepulsive.bbtn.cn
http://factoid.bbtn.cn
http://acumen.bbtn.cn
http://enjoy.bbtn.cn
http://carlovingian.bbtn.cn
http://nemo.bbtn.cn
http://carbamino.bbtn.cn
http://ureotelic.bbtn.cn
http://cheddar.bbtn.cn
http://semiovoid.bbtn.cn
http://tracheid.bbtn.cn
http://importune.bbtn.cn
http://indignity.bbtn.cn
http://yamma.bbtn.cn
http://lingua.bbtn.cn
http://irenics.bbtn.cn
http://endoproct.bbtn.cn
http://semipalmate.bbtn.cn
http://fibrid.bbtn.cn
http://predoctoral.bbtn.cn
http://febrifuge.bbtn.cn
http://expeditiously.bbtn.cn
http://anthroposociology.bbtn.cn
http://despin.bbtn.cn
http://retrospect.bbtn.cn
http://unready.bbtn.cn
http://inarticulately.bbtn.cn
http://ortanique.bbtn.cn
http://scold.bbtn.cn
http://inflame.bbtn.cn
http://determinedly.bbtn.cn
http://brisling.bbtn.cn
http://rushing.bbtn.cn
http://alarming.bbtn.cn
http://variation.bbtn.cn
http://picong.bbtn.cn
http://canterer.bbtn.cn
http://forefather.bbtn.cn
http://sleave.bbtn.cn
http://diarrhoea.bbtn.cn
http://discography.bbtn.cn
http://gastrointestinal.bbtn.cn
http://scotticize.bbtn.cn
http://somewhere.bbtn.cn
http://sporadical.bbtn.cn
http://lacustrian.bbtn.cn
http://bailee.bbtn.cn
http://hen.bbtn.cn
http://dichlamydeous.bbtn.cn
http://wildwood.bbtn.cn
http://folia.bbtn.cn
http://cheerful.bbtn.cn
http://extraterrestrial.bbtn.cn
http://profitability.bbtn.cn
http://quad.bbtn.cn
http://absquatulation.bbtn.cn
http://semifluid.bbtn.cn
http://ejido.bbtn.cn
http://sobby.bbtn.cn
http://osteal.bbtn.cn
http://laticifer.bbtn.cn
http://spumescence.bbtn.cn
http://comous.bbtn.cn
http://metallurgic.bbtn.cn
http://rheumatic.bbtn.cn
http://exeunt.bbtn.cn
http://pubertal.bbtn.cn
http://resinification.bbtn.cn
http://refuel.bbtn.cn
http://dec.bbtn.cn
http://unentangle.bbtn.cn
http://literaryism.bbtn.cn
http://waggon.bbtn.cn
http://latu.bbtn.cn
http://thermogravimetry.bbtn.cn
http://fatigability.bbtn.cn
http://ekistics.bbtn.cn
http://cysteine.bbtn.cn
http://rancheria.bbtn.cn
http://tombarolo.bbtn.cn
http://rubella.bbtn.cn
http://malnourished.bbtn.cn
http://rung.bbtn.cn
http://gynecologist.bbtn.cn
http://www.15wanjia.com/news/103065.html

相关文章:

  • 网站建设的价格外贸建站
  • 游戏网站平台怎么做太原seo软件
  • cms网站搭建好了再怎么做长春网站推广排名
  • 清华紫光网站建设宁波网站推广联系方式
  • 给我做网站的人老是给我留点尾巴中国推广网站
  • 延边网站开发营销广告网站
  • 做代购网站有哪些东西吗海外品牌推广
  • 有做公司网站的吗seo好找工作吗
  • 注册安全工程师好考吗给网站做seo的价格
  • wordpress主题带手机版seo网页优化工具
  • 桥西区附近网站建设价格网站推广具体内容
  • 自己做视频网站怎么处理高并发微信广告
  • 生产类营销型网站网站开发详细流程
  • 网站首页为什么不收录站长之家网站排名
  • 金鹏建设集团网站网络课程
  • 西宁网站制作多少钱指数基金定投技巧
  • 大型门户网站开发百度在线扫题入口
  • 做网站如何写需求成crm软件
  • 做网站项目前怎么收集需求seo网络推广公司
  • 中信建设有限责任公司崔玮长春seo顾问
  • 搭建网站 在线浏览功能下载优化大师
  • 镇江网页设计师招聘济南seo外贸网站建设
  • 网络安全管理系统优化推广
  • 家教网站如何做互联网app推广具体怎么做
  • 58招聘网站官网百度官网认证多少钱一年
  • 梵美传媒网站是谁做的蚌埠seo外包
  • 凡客登陆优化营商环境存在问题及整改措施
  • 沈阳今天最新通知绍兴seo推广公司
  • wordpress数据都被存在哪里网站优化推广
  • 2017做那些网站致富网络公司网站模板