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

wordpress域名网站搬家怎样做才能发布你的网站

wordpress域名网站搬家,怎样做才能发布你的网站,侧边栏jquery网站后台,2022年大连黄页题意#xff1a; 给n个小朋友分发糖果#xff0c;但小朋友们之间有嫉妒心。接下来m行#xff0c;每行三个数#xff0c;分别表示小朋友A希望B得到的糖果不能比他多x个。要求你计算在满足所有小朋友的条件的情况下最多需要准备多少颗糖。 题目#xff1a; During the ki…题意 给n个小朋友分发糖果但小朋友们之间有嫉妒心。接下来m行每行三个数分别表示小朋友A希望B得到的糖果不能比他多x个。要求你计算在满足所有小朋友的条件的情况下最多需要准备多少颗糖。 题目 During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids loved candies very much and often compared the numbers of candies they got with others. A kid A could had the idea that though it might be the case that another kid B was better than him in some aspect and therefore had a reason for deserving more candies than he did, he should never get a certain number of candies fewer than B did no matter how many candies he actually got, otherwise he would feel dissatisfied and go to the head-teacher to complain about flymouse’s biased distribution. snoopy shared class with flymouse at that time. flymouse always compared the number of his candies with that of snoopy’s. He wanted to make the difference between the numbers as large as possible while keeping every kid satisfied. Now he had just got another bag of candies from the head-teacher, what was the largest difference he could make out of it? Input The input contains a single test cases. The test cases starts with a line with two integers N and M not exceeding 30 000 and 150 000 respectively. N is the number of kids in the class and the kids were numbered 1 through N. snoopy and flymouse were always numbered 1 and N. Then follow M lines each holding three integers A, B and c in order, meaning that kid A believed that kid B should never get over c candies more than he did. Output Output one line with only the largest difference desired. The difference is guaranteed to be finite. Sample Input 2 2 1 2 5 2 1 4 Sample Output 5 Hint 32-bit signed integer type is capable of doing all arithmetic. 分析 1.这道题目是典型的差分约束系统小于等于是最短路 大于等于是最长路核心在于xj-xibk会发现它类似最短路中的三角不等式d[v]d[u]w[u,v]即d[v]-d[u]w[u,v]即从u指向v建边num[B]num[A]x。求最大值的话就是跑1-n的最短路对应求最小值就是跑1-n的最长路。此题用队列的话会T掉可以改成栈或者想办法优化。 2.关于差分约束选择队列还是堆栈当存在回路SPFA的队列实现会超时堆栈实现可以堆栈实现SPFA有时候堆栈确实比较快 都大三的老阿姨了差分约束还不熟练加油吧查缺补漏中。。。。 AC代码 #includestdio.h #includestring.h #includealgorithm using namespace std; const int inf0x3f3f3f3f; const int M3e410; const int N15e410; int n,m,k,a,b,c; int vis[M]/**在队列标志*/; int head[M]/**每个结点的头指针(或者编号)*/; int q[M]/**堆栈*/,dis[M]; struct node {int b;int c;int next; }edge[N];void add(int a,int b,int c)//加边 {edge[k].bb;edge[k].cc;edge[k].nexthead[a];head[a]k; } void SPFA(int start,int n) {int top0;for(int i1;in;i)//初始化{if(istart){q[top]i;//入栈vis[i]true;dis[i]0;}else{vis[i]false;dis[i]inf;}}while(top!0){int aq[--top];vis[a]false;for(int ihead[a];i!-1;iedge[i].next){int bedge[i].b;if(dis[b]dis[a]edge[i].c){dis[b]dis[a]edge[i].c;if(!vis[b]){vis[b]true;q[top]b;}}}} } int main() {while(~scanf(%d%d,n,m)){k0;//加边计数这个不要忘memset(head,-1,sizeof(head));for(int i0;im;i){scanf(%d%d%d,a,b,c);add(a,b,c);}SPFA(1,n);//printf(*****\n);printf(%d\n,dis[n]);//此处求n比1最多多多少糖果}return 0; } /**给n个人派糖果给出m组数据每组数据包含A、B、c 三个数 意思是A的糖果数比B少的个数不多于c,即B的糖果数 - A的糖果数 c 。 最后求n 比 1 最多多多少糖果。*/
http://www.yutouwan.com/news/55562/

相关文章:

  • 一个网站为什么做的不好看精品资料网官方网站
  • 网站设计制作厂家有哪些千锋教育培训多少钱
  • 学什么可以做推广网站网络营销产品策略案例
  • wordpress注册表单插件网站内容优化怎么去优化呢
  • 秦皇岛网站建公司做幼儿英语的教案网站
  • html5集团网站网站域名icp 备案价格
  • 兴安网站建设上海传媒公司总裁李闪闪
  • 福州做网站价格wordpress 不显示账号名
  • 手机网站申请安阳实力网站建设首选
  • 做品牌网站哪个好用网站知名度推广
  • 网站恢复江苏镇江市
  • 搜狐做网站微信小程序界面设计模板
  • 黄岛区做网站的网站扩展虚拟空间
  • 网站建设推推蛙深圳威豹押运公司官网
  • 金融类网站建设做电影网站哪个服务器好
  • 开发者选项seo全称是什么意思
  • 华夏名网网站建设wordpress supercache
  • 个人网站的名称建筑人才培训网
  • 重庆渝中区企业网站建设联系电话屏蔽网站推广
  • 两个网站如何做端口映射wordpress 发布文章功能修改
  • 网站建设推广怎样找客户WordPress添加在线商店
  • 用angularjs做的网站成都英文网站建设
  • 网站备案负责人一定要法人网站建设前台和后台
  • 企业网站html5怎么申请app软件
  • 哪个网站可以免费做音乐相册广州番禺区地图高清版大图
  • 学做网站需要学那些程序昌江区网站建设
  • 济南网站建设哪家专业互联网平台是什么意思
  • seo建站优化推广佛山建站
  • 做网站网页的专业wordpress 计数
  • 网站的物理结构阿里云 做网站 百度开放云