搜狐_装箱子
来源:互联网 发布:星界边境 传输网络 编辑:程序博客网 时间:2024/06/05 15:15
AC了的
public class zhuangxiangz {public static void main(String[] args) {int a,b,c,d,e,f; //分别表示六中木块 int ans = 0; //需要的箱子数 int x,y; //x表示用完四个大的木块剩下 2*2的位置 y表示剩下的1*1的位置 int[] three = {0,5,3,1}; //3*3的个数除4剩下的有多少2*2的剩余位置 Scanner scan=new Scanner(System.in);while(scan.hasNext()){a=scan.nextInt();b=scan.nextInt();c=scan.nextInt();d=scan.nextInt();e=scan.nextInt();f=scan.nextInt();if(a==b && b==c && c==d && d==e && e==f ){break;} ans = f+e+d+(c+3)/4; y = d*5+ three[c%4]; if(b>y) ans += (b-y+8)/9; x = 36*ans-36*f-25*e-16*d-9*c-b*4; if(a>x) ans += (a-x+35)/36; System.out.println(ans); }}}
阅读全文
0 0
- 搜狐_装箱子
- 【搜狐8.28】装箱子
- 2017.08.28 搜狐笔试题 六种体积包裹装箱子求最少箱子数量
- 装箱子
- 装箱子
- 装箱子
- 1014_装箱问题
- 2018搜狐编程题-贪心算法-二维装箱问题
- DP_01背包_装箱问题
- poj 1017 Packets装箱子
- 1017 货物装箱子问题
- poj 1017 装箱子问题
- 雅虎搜狐创新工场微软_五道算法题
- 搜狐2017实习生笔试题_概率问题
- 最长递增子序列,(搜狐[编程题]马戏团)
- 装箱
- 装箱
- 装箱
- 游历魔法王国
- Vue系列——在vue项目中使用echarts
- [BZOJ]1854 [SCOI]2010 游戏
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- MySQL:常用语句
- 搜狐_装箱子
- SVN trunk(主线) branch(分支) tag(标记) 用法详解和详细操作步骤
- 动态规划思想:石子合并问题
- Go基础编程:第一个Go程序
- 正则表达式判断手机号的合法性
- 大整数乘法
- SVG动画
- C#中的SQLite,出现“v2.0.50727”...无法在 4.0 运行时中加载该程序集
- Android 编译命令