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

有没有教做蛋糕的网站wordpress调整小工具位置

有没有教做蛋糕的网站,wordpress调整小工具位置,贵州省建设厅官网网站,洛阳哪家网站做的好1. 华为OD机考题 答案 2023华为OD统一考试#xff08;AB卷#xff09;题库清单-带答案#xff08;持续更新#xff09; 2023年华为OD真题机考题库大全-带答案#xff08;持续更新#xff09; 2. 面试题 一手真实java面试题#xff1a;2023年各大公司java面试真题汇总--… 1. 华为OD机考题 答案 2023华为OD统一考试AB卷题库清单-带答案持续更新 2023年华为OD真题机考题库大全-带答案持续更新 2. 面试题 一手真实java面试题2023年各大公司java面试真题汇总--持续更新 3. 技术知识 java后端技术汇总 中间件 架构思想 题目描述 公司分月饼m个员工买了n个月饼m n每个员工至少分一个月饼但是也可以分到多个单人分到最多月饼的个数是Max1单人分到第二多月饼个数是Max2。 但需要满足Max1-Max2 3单人分到第n-1多月饼个数是Max(n-1)单人分到第n多月饼个数是Max(n), 想要满足Max(n-1) - Max(n) 3问有多少种分月饼的方法 输入描述 每一行输入mn表示m个员工n个月饼m n 输出描述 输出有多少种分法 示例1 输入 2 4 输出 2 说明 413 422 注意13和31要算成同一种分法 示例2 输入 3 5 输出 2 说明 5113 5123 示例3 输入 3 12 输出 6 说明 满足要求的6种分法 1、12 1 1 10 Max110 Max21不满足Max1-Max2 3的约束 2、12 1 2 9 Max19Max22不满足Max1-Max2 3的约束 3、12 1 3 8 Max18Max23不满足Max1-Max2 3的约束 4、12 1 4 7 Max17Max24Max31 满足要求 5、12 1 5 6 Max16Max25Max31 不满足要求 6、12 2 2 8 Max18Max22不满足要求 7、12 2 3 7 Max17Max23不满足要求 8、12 2 4 6 Max16Max24Max32 满足要求 9、12 2 5 5 Max15Max22 满足要求 10、12 3 3 6 Max16Max23 满足要求 11、12 3 4 5 Max15Max24Max33 满足要求 12 4 4 4 Max14满足要求 public class DivideMooncake { //非最优解需要考虑减枝减少遍历次数。public static void main(String[] args) {Scanner scanner new Scanner(System.in);int [] num Arrays.stream(scanner.nextLine().split( )).mapToInt(Integer::parseInt).toArray();//分配人数int peoples num[0];//待分配数量int dnum num[1] - num[0];//重新分配后每个人月饼数量int [] nums new int[peoples];// 用一个List来存储所有分配方案ListListInteger result new ArrayList();divide(dnum,peoples,nums,result);ListListIntegerfilteredResult removeDuplicate(result);//System.out.println(filteredResult);System.out.println(filteredResult.size());}public static void divide(int num,int peolpe, int [] nums,ListListInteger result){if (peolpe 1){nums[0] num;ListInteger allocation new ArrayList();for (int i : nums){allocation.add(i);}result.add(allocation);return;}for (int i 0; i num ; i){//要分配的月饼nums[peolpe - 1] i;//递归调用将要分配的月饼分配给其它人divide(num - i,peolpe -1,nums,result);}}/*** 判断是否满足条件 Max(n) - Max(n-1) 3* param nums* return*/public static Boolean satisfy(ListInteger nums){int i nums.size() -1;while (i 1){if (nums.get(i) - nums.get(i - 1) 3){return false;}i--;}return true;}/*** 分数一致的去重* param result* return*/public static ListListInteger removeDuplicate(ListListInteger result) {ListListInteger filteredResult new ArrayList();for (ListInteger allocation : result) {boolean duplicate false;allocation.sort(Integer::compareTo); // 对分配方案进行排序for (ListInteger existingAllocation : filteredResult) {existingAllocation.sort(Integer::compareTo); // 对已有的分配方案进行排序if (Arrays.equals(existingAllocation.toArray(), allocation.toArray())) {duplicate true; // 分配方案重复break;}}if (!duplicate) {if (satisfy(allocation)){filteredResult.add(allocation);}}}return filteredResult;}}
http://www.hkea.cn/news/14470703/

相关文章:

  • 中国建设部官方网站监理转注册外贸建站是什么意思
  • 网站建设注意什么广告 网站举例
  • 广东seo网站优化公司网页设计实训报告设计思路
  • 厦门满山红网站建设动画制作软件哪个好用
  • 上虞区住房和城乡建设局网站外贸人常用的app
  • 网站开发区九冶建设有限公司网站
  • iis7配置asp.net网站顺企网贵阳网站建设
  • 视频封面制作网站seo站长助手
  • spring mvc 网站开发福州最新通告今天
  • 网站集约化建设性能要求公司模块网站制作
  • 住房和城乡建设厅官方网站建行网站会员
  • 上海网站建设市场win网站建设
  • 网页设计模板网站免费下载套餐网站
  • 网站的建设报价和朋友合伙做网站
  • 有做盆景的网站团购网站平台建设
  • 苏州网站开发公司排名黑龙江建设监理协会网站
  • 西昌城乡建设网站嵌入式开发就业前景
  • 青岛市医疗保险网站股票软件定制
  • 小县城做服务网站网站建设申请总结
  • 小游戏网站网址一个网站想看访客量怎么做
  • 苏州网站开发公司济南兴田德润厉害吗单位不能建设网站
  • 永川区网站建设咨询网站文章seo
  • 最新手机网站推荐wordpress还是shopify
  • 查询网站备案密码是什么国际新闻联播
  • 做网站前端wordpress黑糖
  • 建设网站书关于珠海网站建设的优势
  • 免费网站建设排行榜wordpress获取自定义文章列表
  • 网站后台管理系统设计扬州有做义工的地方或网站嘛
  • 网站编辑信息怎么做免费成品网站模板
  • 淘宝网站jquerywordpress怎么添加数据库连接