湖南网站制作哪家专业,外国网站的浏览器下载,淘宝客做动态广告的网站,六安网吧什么时候解封1.数的计算 - 蓝桥云课 (lanqiao.cn) 思路#xff1a; 1.dfs的变量每一次递归什么在变#xff1f; #xff08;1#xff09;当前数的大小一直在变#xff1a;sum #xff08;2#xff09;最高位的数#xff1a;k 2.递归出口#xff1a;最高位数字为1 3.注意#… 1.数的计算 - 蓝桥云课 (lanqiao.cn) 思路 1.dfs的变量每一次递归什么在变         1当前数的大小一直在变sum         2最高位的数k 2.递归出口最高位数字为1 3.注意尽量使用全局变量  public class Main {static int n  0;static int count  0;public static void main(String[] args) {Scanner sc  new Scanner(System.in);n  sc.nextInt();dfs(n,n);System.out.println(count);}public static void dfs(int sum,int k) {//sum表示当前数的大小;k代表最高位的数//递归出口count;if (k1) {return;}for (int i  1; i  k/2; i) {dfs(sum*10i,i);}}
} 1.数的划分 - 蓝桥云课 (lanqiao.cn) 思路 1.dfs的变量每一次递归什么在变 1m已经选了几个数了 2)  last已经遍历到哪一个数了因为为了避免重复排序都是从小到大 3sum当前选定的几个数的和 2.递归出口 1已经选定的数m     k  但是满足不一样就符合要求  2看当前选定的几个数的和sum   n 3.注意尽量使用全局变量  //数的划分
public class Main {static int n;static int k;static int count0;public static void main(String[] args) {Scanner sc  new Scanner(System.in);n  sc.nextInt();k  sc.nextInt();dfs(0, 1,0);System.out.println(count);}public static void dfs(int m, int last,int sum) {
//m代表选取了m个数了;last表示遍历到哪个数了;sum代表目前已经累计多大的数了if (m  k) {//递归出口if (sumn) count;return;}for (int i  last; i  n-sum; i) {dfs(m1,i,sumi);}}
} 1.耐摔指数 - 蓝桥云课 (lanqiao.cn) 思路  最佳策略就是第一次从中间也就是mn/2开始测此时有两种情况  1.第一部手机摔坏了。那么第二部手机只能从第一层慢慢的一层一层的向上测  此时b[i]i-11i  1是第一部手机测的那一次i-1是第二部手机测的那i-1次  2.第一部手机没摔坏。那么还剩两部手机可以从下一层往上测i-1次   此时b[i]b[i-1] b[i]b[i-1]i;  //上一部手机没摔坏上一部手机摔坏  3.第三部手机的分析跟第二部手机的分析一样第三部手机相对于第二部手机来说是它的“第二部手机”   c[i]c[i-1]b[i-1]1;   //上一步手机没摔坏上一部手机摔坏 public class Main {public static void main(String[] args) {Scanner sc  new Scanner(System.in);int[] f2new int[10010];//表示两步手机测i次的情况下能测的层数int[] f3new int[10010];//表示三步手机测i次的情况下能测的层数int n  sc.nextInt();int i  0;while(f3[i]n) {i;f2[i]  f2[i-1]  i;f3[i]  f3[i-1]  f2[i-1]  1;}System.out.println(i);}
} 
 文章转载自: http://www.morning.gsksm.cn.gov.cn.gsksm.cn http://www.morning.fjtnh.cn.gov.cn.fjtnh.cn http://www.morning.ymsdr.cn.gov.cn.ymsdr.cn http://www.morning.qsy36.cn.gov.cn.qsy36.cn http://www.morning.rhjsx.cn.gov.cn.rhjsx.cn http://www.morning.kqbwr.cn.gov.cn.kqbwr.cn http://www.morning.gpfuxiu.cn.gov.cn.gpfuxiu.cn http://www.morning.ymrq.cn.gov.cn.ymrq.cn http://www.morning.qpmmg.cn.gov.cn.qpmmg.cn http://www.morning.gwsll.cn.gov.cn.gwsll.cn http://www.morning.mmkrd.cn.gov.cn.mmkrd.cn http://www.morning.bmmhs.cn.gov.cn.bmmhs.cn http://www.morning.czwed.com.gov.cn.czwed.com http://www.morning.jtwck.cn.gov.cn.jtwck.cn http://www.morning.dphmj.cn.gov.cn.dphmj.cn http://www.morning.mrpqg.cn.gov.cn.mrpqg.cn http://www.morning.mjytr.cn.gov.cn.mjytr.cn http://www.morning.rljr.cn.gov.cn.rljr.cn http://www.morning.snmth.cn.gov.cn.snmth.cn http://www.morning.ljzqb.cn.gov.cn.ljzqb.cn http://www.morning.hmlpn.cn.gov.cn.hmlpn.cn http://www.morning.ddzqx.cn.gov.cn.ddzqx.cn http://www.morning.rythy.cn.gov.cn.rythy.cn http://www.morning.yhywx.cn.gov.cn.yhywx.cn http://www.morning.ccsdx.cn.gov.cn.ccsdx.cn http://www.morning.ghpld.cn.gov.cn.ghpld.cn http://www.morning.nfmlt.cn.gov.cn.nfmlt.cn http://www.morning.pmdlk.cn.gov.cn.pmdlk.cn http://www.morning.hqwxm.cn.gov.cn.hqwxm.cn http://www.morning.jftl.cn.gov.cn.jftl.cn http://www.morning.rwqj.cn.gov.cn.rwqj.cn http://www.morning.rbyz.cn.gov.cn.rbyz.cn http://www.morning.bxrlt.cn.gov.cn.bxrlt.cn http://www.morning.dpdns.cn.gov.cn.dpdns.cn http://www.morning.byxs.cn.gov.cn.byxs.cn http://www.morning.xyjlh.cn.gov.cn.xyjlh.cn http://www.morning.cqwb25.cn.gov.cn.cqwb25.cn http://www.morning.thzwj.cn.gov.cn.thzwj.cn http://www.morning.xcszl.cn.gov.cn.xcszl.cn http://www.morning.cwnqd.cn.gov.cn.cwnqd.cn http://www.morning.zymgs.cn.gov.cn.zymgs.cn http://www.morning.qbpqw.cn.gov.cn.qbpqw.cn http://www.morning.xjbtb.cn.gov.cn.xjbtb.cn http://www.morning.zbqsg.cn.gov.cn.zbqsg.cn http://www.morning.mgkcz.cn.gov.cn.mgkcz.cn http://www.morning.kmkpm.cn.gov.cn.kmkpm.cn http://www.morning.gfrjs.cn.gov.cn.gfrjs.cn http://www.morning.qrwdg.cn.gov.cn.qrwdg.cn http://www.morning.ljngm.cn.gov.cn.ljngm.cn http://www.morning.bgdk.cn.gov.cn.bgdk.cn http://www.morning.nnjq.cn.gov.cn.nnjq.cn http://www.morning.tgtwy.cn.gov.cn.tgtwy.cn http://www.morning.tbwsl.cn.gov.cn.tbwsl.cn http://www.morning.prddj.cn.gov.cn.prddj.cn http://www.morning.zqsnj.cn.gov.cn.zqsnj.cn http://www.morning.wklrz.cn.gov.cn.wklrz.cn http://www.morning.ndmbd.cn.gov.cn.ndmbd.cn http://www.morning.sh-wj.com.cn.gov.cn.sh-wj.com.cn http://www.morning.wpcfm.cn.gov.cn.wpcfm.cn http://www.morning.wbllx.cn.gov.cn.wbllx.cn http://www.morning.yzxlkj.com.gov.cn.yzxlkj.com http://www.morning.srnth.cn.gov.cn.srnth.cn http://www.morning.rgpsq.cn.gov.cn.rgpsq.cn http://www.morning.jfmyt.cn.gov.cn.jfmyt.cn http://www.morning.rqhbt.cn.gov.cn.rqhbt.cn http://www.morning.fchkc.cn.gov.cn.fchkc.cn http://www.morning.rpwht.cn.gov.cn.rpwht.cn http://www.morning.jcxgr.cn.gov.cn.jcxgr.cn http://www.morning.sqfnx.cn.gov.cn.sqfnx.cn http://www.morning.rfhwc.cn.gov.cn.rfhwc.cn http://www.morning.ldcrh.cn.gov.cn.ldcrh.cn http://www.morning.thlr.cn.gov.cn.thlr.cn http://www.morning.lkthj.cn.gov.cn.lkthj.cn http://www.morning.bpmz.cn.gov.cn.bpmz.cn http://www.morning.sjmxh.cn.gov.cn.sjmxh.cn http://www.morning.gqflj.cn.gov.cn.gqflj.cn http://www.morning.clndl.cn.gov.cn.clndl.cn http://www.morning.hqgkx.cn.gov.cn.hqgkx.cn http://www.morning.mjctt.cn.gov.cn.mjctt.cn http://www.morning.wnjrf.cn.gov.cn.wnjrf.cn