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

工业产品设计图wordpress建站优化

工业产品设计图,wordpress建站优化,wordpress做新闻cms,重庆建站公司题意#xff1a; 给20个水碗。朝上为‘0’或朝下为‘1’#xff0c;每次操作使三个碗翻转#xff0c;问使所有20个水碗都朝上#xff0c;至少翻多少次#xff1f; 题目#xff1a; The cows have a line of 20 water bowls from which they drink. The bowls can be e…题意 给20个水碗。朝上为‘0’或朝下为‘1’每次操作使三个碗翻转问使所有20个水碗都朝上至少翻多少次 题目 The cows have a line of 20 water bowls from which they drink. The bowls can be either right-side-up (properly oriented to serve refreshing cool water) or upside-down (a position which holds no water). They want all 20 water bowls to be right-side-up and thus use their wide snouts to flip bowls. Their snouts, though, are so wide that they flip not only one bowl but also the bowls on either side of that bowl (a total of three or – in the case of either end bowl – two bowls). Given the initial state of the bowls (1undrinkable, 0drinkable – it even looks like a bowl), what is the minimum number of bowl flips necessary to turn all the bowls right-side-up? Input Line 1: A single line with 20 space-separated integers Output Line 1: The minimum number of bowl flips necessary to flip all the bowls right-side-up (i.e., to 0). For the inputs given, it will always be possible to find some combination of flips that will manipulate the bowls to 20 0’s. Sample Input 0 0 1 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 Sample Output 3 Hint Explanation of the sample: Flip bowls 4, 9, and 11 to make them all drinkable: 0 0 1 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 [initial state] 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 [after flipping bowl 4] 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 [after flipping bowl 9] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [after flipping bowl 11] 分析 这个题直接暴力过得直接正反遍历找最小值还有一种构造增广矩阵类似于根据开关的关系构造有向图的邻接矩阵构造增广矩阵高斯消元枚举自由元二进制枚举状态寻找最小值的方法因为时间关系就没有去钻研在这提供下思路。 AC代码 #includestdio.h #includestring.h #includealgorithm using namespace std; int a[30],b[30]; int ans,num; int main(){for(int i1;i20;i){scanf(%d,a[i]);b[i]a[i];}numans0;for(int i1;i20;i){if(a[i]1){ans;a[i1]!a[i1];a[i2]!a[i2];}}for(int i20;i1;i--){if(b[i]1){num;b[i-1]!b[i-1];b[i-2]!b[i-2];}}ansmin(ans,num);printf(%d\n,ans);return 0; }
http://www.sadfv.cn/news/324557/

相关文章:

  • 网站内容策略东莞做网站哪家最好
  • 网站开发实例视频高端视觉网站
  • 网站备案名称更换电子商务网站开发人员要求
  • 网站图片怎么优化什么是网站的空间
  • 金光华网站建设网站模版怎么上传到空间
  • 只做自己网站网站在线开发
  • 芜湖做网站电商设计工资多少钱一个月
  • 建一个网站需要什么资料收录好的网站
  • 免费公司网站模版ios开发者账号有什么用
  • 网站建设与维护实训wordpress home index
  • 制作网页的过程上海搜索排名优化
  • 赣州网站开发公司it类网站
  • 延庆精神文明建设的门户网站汕头网站建设制作方案
  • 怎样策划一个营销型网站重庆网站seo好不好
  • 免费建网站 高校社团官方网站做不规则几何图形的网站
  • 网络营销图片威海网站优化
  • 网站建设主要问题及建议嘉峪关外包网络推广
  • 如何做话费卡回收网站wangz网站建设
  • wordpress表单 慢合肥网站seo费用
  • 深圳做网站网络营销公司排名专业团队表情包张伟
  • 怎样提交网站百度收录做外贸采购都是用什么网站
  • 做淘宝详情的网站深圳美容网站建
  • 人力资源公司网站建设wordpress 餐饮
  • 外网设计网站大型电商网站开发方案
  • 云南省住房和建设执业资格注册中心网站零售管理系统哪个软件好
  • 资阳网站推广阿里巴巴网站开发是谁
  • 做一的同志小说网站有哪些晋江怎么交换友情链接
  • 网站的信息容量网站设计师和网页设计师的区别
  • 绵阳网站关键词域名网站有哪些
  • 最短的网站个人虚拟网站