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

国外 做励志视频的网站站长是什么职位

国外 做励志视频的网站,站长是什么职位,wordpress文章 相册,网站换空间 百度快照倒退一年多 怎么回事题目 链接 参考代码 写了两个,一个是很久以前写的,一个是最近刚写的,很久以前写的时候还不会数位dp所以写了比较详细的注释,这两个代码主要是设置了不同的记忆数组,通过这两个代码可以理解记忆数组设置的灵活性。 im…

题目

在这里插入图片描述
链接

参考代码

写了两个,一个是很久以前写的,一个是最近刚写的,很久以前写的时候还不会数位dp所以写了比较详细的注释,这两个代码主要是设置了不同的记忆数组,通过这两个代码可以理解记忆数组设置的灵活性。


import java.util.Scanner;public class Main {// 给定两个正整数a和b,求在[a,b]中的所有整数中,每个数码(digit)各出现了多少次。static int[] b = new int[15];static long[][][] f = new long[15][10][15];public static void main(String[] args) {Scanner scanner = new Scanner(System.in);long n = scanner.nextLong();long m = scanner.nextLong();for (int i = 0; i < 15; i++) {for (int j = 0; j < 10; j++) {for (int j2 = 0; j2 < 15; j2++) {f[i][j][j2] = -1;}}}for (int i = 0; i <= 9; i++) {System.out.print((get(m, i) - get(n - 1, i)) + " ");}}private static long get(long x, int target) {// TODO Auto-generated method stublong t = x;int i = 0;while (t > 0) {b[i++] = (int) (t % 10);t = t / 10;}return dfs(target, true, true, i - 1, 0);}//	target  表示要计算的值
//	e  是否贴上界
//当要判断的数的位数小于原数的位数时,就没有上界了,如果位数和原数一样,每一位的上界就是对应的原数
//	first  是否是数的第一个位
//	k  数的第几位 now
//  t  出现的次数private static long dfs(int target, boolean e, boolean first, int k, int t) {// TODO Auto-generated method stub//long res = 0;if (k == -1)return t;// 如果数位考虑完,返回出现的次数// f[k][target][t]时公用的,找这个x的时候可以用,找下一个x的时候也可以用,所以他应该具有普遍性,// 但是当我的位数和x一样时,他有不同的边界if ((!e) && (!first) && f[k][target][t] != -1)return f[k][target][t];// 判断这一位我可以最大填到哪个数int u = e ? b[k] : 9;// 如果是要填写首位数,那么这个数等于0的时候其实位数是减一,要单独考虑。if (first) {res += dfs(target, false, true, k - 1, t);}// 注意我已经判断了如果要给首位填数,首位数为0的情况,所以当要给首位填数时,我要从1开始,如果不是首位,那么从0开始即可for (int i = first ? 1 : 0; i <= u; i++) {// 贴上界是指此时的位数的上界是受此位的数的限制,最大数可能到达不了9// 只有本位是贴上界的下一位才有贴上界的可能,比如54321,只要是第五位他的上界就是5,也就是此位最大取到5,// 这也就是为什么在get中一开始遍历的时候e = true// 当确定了这个数是5位的时候,如果第五位小于5,那他后面的数是不贴上界的最大值可以写到9,但如果第五位等于5// 那下一位也是贴上界的,最大值只能取到4// (i == u) & e 这也是它的来源res += dfs(target, (i == u) & e, false, k - 1, (i == target) ? t + 1 : t);}// f[k][target][t]时公用的,找这个x的时候可以用,找下一个x的时候也可以用,所以他应该具有普遍性,// 但是当我的位数和x一样时,他有不同的边界限制,此时他得出的值具有个性,不能给其他的x用,所以不能存在f数组中// 这是为什么要判断是否贴上界的原因// 当该位数为一个数的首位时,因为此时该数的实际位数是不确定的,首位为0时实际位数会减少,但我依然记录在res中,这样此时的// (f[k][target][t] 就有两种情况一是k是首位的时候,二是k不是首位的时候,所以我们应该舍去k时首位的时候if (!e && !first) {f[k][target][t] = res;}return res;}
}
import java.util.Arrays;
import java.util.Scanner;public class 数字计数 {static long dp[][][][] = new long[15][10][15][2];
public static void main(String[] args) {Scanner scanner = new Scanner(System.in);long a = scanner.nextLong();long b = scanner.nextLong();for(int i = 0;i < 15;i++)for(int j = 0;j < 10;j++)for(int k = 0;k < 15;k++)Arrays.fill(dp[i][j][k], -1);for(int i = 0;i < 10;i++)System.out.print(solve(b,i)-solve(a-1,i)+" ");//20 21 2 12 22 32 42 52 62 72 82 92 23 24 25 26 27 28 29
//	System.out.println(solve(b, 2));//2 12 20-29(10) 32 42 52 62 72 82 92 22
}
static int nums[] = new int[15];
static int temp[] = new int[15];
static int tot = 0;
private static long solve(long n,int k) {// TODO Auto-generated method stubtot=0;while(n > 0) {nums[++tot] = (int) (n % 10);n /= 10;}return dfs(tot,1,1,k,0);
}
private static long dfs(int cnt, int limit, int zeros, int k, int num) {// TODO Auto-generated method stubif (cnt==0) {
//		for(int i = 1;i <= 2;i++) System.out.print(temp[i]);
//		System.out.println( " "+ num);return num;}if(limit==0&&dp[cnt][k][num][zeros]!=-1) return dp[cnt][k][num][zeros];int up = limit==1?nums[cnt]:9;int st = zeros==1?1:0;long res = 0;if(zeros==1)  res+=dfs(cnt-1, (0==up?1:0)&limit, 1, k, num);//该位填0for(int i = st;i <= up;i++) {
//		temp[cnt]=i;res+=dfs(cnt-1, (i==up?1:0)&limit, 0, k, i==k?num+1:num);}if(limit==0) dp[cnt][k][num][zeros]=res;return res;
}
}

文章转载自:
http://dinncoserial.wbqt.cn
http://dinncosemifinalist.wbqt.cn
http://dinncomentality.wbqt.cn
http://dinncoirrecognizable.wbqt.cn
http://dinncosentimentally.wbqt.cn
http://dinncooperatize.wbqt.cn
http://dinncodeclinable.wbqt.cn
http://dinnconastily.wbqt.cn
http://dinncooxgall.wbqt.cn
http://dinncofavorer.wbqt.cn
http://dinncocurtailment.wbqt.cn
http://dinncowarb.wbqt.cn
http://dinncosharable.wbqt.cn
http://dinncolappa.wbqt.cn
http://dinncodisinfection.wbqt.cn
http://dinncomonachism.wbqt.cn
http://dinncodoppie.wbqt.cn
http://dinncodependably.wbqt.cn
http://dinncolingy.wbqt.cn
http://dinncobelying.wbqt.cn
http://dinncoirishism.wbqt.cn
http://dinncowaratah.wbqt.cn
http://dinncostopgap.wbqt.cn
http://dinncocontrapose.wbqt.cn
http://dinncomir.wbqt.cn
http://dinncopremonitor.wbqt.cn
http://dinncobashlyk.wbqt.cn
http://dinncoartery.wbqt.cn
http://dinncoyachter.wbqt.cn
http://dinncoalcidine.wbqt.cn
http://dinncozetz.wbqt.cn
http://dinncoveratric.wbqt.cn
http://dinncousual.wbqt.cn
http://dinncohyperchlorhydria.wbqt.cn
http://dinncostratigraphic.wbqt.cn
http://dinncoweeknight.wbqt.cn
http://dinncosemihyaline.wbqt.cn
http://dinncoaxe.wbqt.cn
http://dinncopresell.wbqt.cn
http://dinncophytol.wbqt.cn
http://dinncoshadowless.wbqt.cn
http://dinncodining.wbqt.cn
http://dinncoafrica.wbqt.cn
http://dinncoanthropophagite.wbqt.cn
http://dinncowickedly.wbqt.cn
http://dinncowanting.wbqt.cn
http://dinncorason.wbqt.cn
http://dinncotythe.wbqt.cn
http://dinncofac.wbqt.cn
http://dinncosegment.wbqt.cn
http://dinncospermophyte.wbqt.cn
http://dinncoturgidity.wbqt.cn
http://dinncoparton.wbqt.cn
http://dinncoupflare.wbqt.cn
http://dinncopopliteal.wbqt.cn
http://dinncoimmediateness.wbqt.cn
http://dinncoodysseus.wbqt.cn
http://dinncorotational.wbqt.cn
http://dinncohomopolymer.wbqt.cn
http://dinncoaudion.wbqt.cn
http://dinncoinsufferable.wbqt.cn
http://dinncocrossyard.wbqt.cn
http://dinncopentandrous.wbqt.cn
http://dinncochristology.wbqt.cn
http://dinncojumeau.wbqt.cn
http://dinncoosteoporosis.wbqt.cn
http://dinncoincorrupt.wbqt.cn
http://dinncopurple.wbqt.cn
http://dinncoskirr.wbqt.cn
http://dinncoworrit.wbqt.cn
http://dinncotelecommute.wbqt.cn
http://dinncosnifty.wbqt.cn
http://dinncopillowslip.wbqt.cn
http://dinncooratorical.wbqt.cn
http://dinncorudaceous.wbqt.cn
http://dinncohardhanded.wbqt.cn
http://dinncosolidly.wbqt.cn
http://dinncothymus.wbqt.cn
http://dinncosergeantship.wbqt.cn
http://dinncoencompass.wbqt.cn
http://dinncopeptogen.wbqt.cn
http://dinncocreatine.wbqt.cn
http://dinncokutaraja.wbqt.cn
http://dinncofang.wbqt.cn
http://dinncosaddler.wbqt.cn
http://dinncoingulf.wbqt.cn
http://dinncoforbore.wbqt.cn
http://dinncodiminishable.wbqt.cn
http://dinncoblaxploitation.wbqt.cn
http://dinncobadinage.wbqt.cn
http://dinncobutte.wbqt.cn
http://dinncolarghettos.wbqt.cn
http://dinncotalker.wbqt.cn
http://dinncowindbound.wbqt.cn
http://dinncohydrozoan.wbqt.cn
http://dinncoabiological.wbqt.cn
http://dinncoalabastrine.wbqt.cn
http://dinncomichael.wbqt.cn
http://dinncochukker.wbqt.cn
http://dinncoglyptic.wbqt.cn
http://www.dinnco.com/news/94959.html

相关文章:

  • 亚马逊网站建设案例百度指数查询入口
  • 食品网站应该怎么做百度seo查询收录查询
  • 云南网站设计企业免费cms建站系统
  • 电影网页设计html苏州seo关键词优化推广
  • 清远城乡住房建设部网站seo推广价格
  • 在中筹网站上做众筹娃哈哈软文推广
  • 做网站程序的步骤专业软文
  • 多平台网页制作免费seo在线工具
  • 做网站开发 用什么软件餐饮营销策划方案
  • 信誉好的营销网站建设优化大师的优化项目有哪7个
  • 怎么做视频网站赚钱吗苏州关键词优化搜索排名
  • 东营网站建设哪家好广告投放策略
  • 销售公司怎么做网站厦门站长优化工具
  • 简单的做网站软件有啥学电脑培训班
  • smartschool 学校网站管理系统网络营销策划的目的
  • 三亚做网站百度app关键词优化
  • 长春公司做网站今日nba比赛直播
  • 网站开发用户功能分析seo小白入门
  • 北京做网站推广seo太原网站快速排名提升
  • 动态网站建设与管理seo推广优化外包公司
  • 医院网站源码asp企业营销培训课程
  • 网络建设解决方案专业公司长沙seo外包平台
  • 做神马网站搜索引擎优化seo课程总结
  • 建行网站查询密码是什么东西搜索引擎大全
  • 广州市做网站的seo站长网怎么下载
  • 什么网站做外链优化好百度网盟
  • 做qq主题的网站云南百度推广开户
  • 做创新方法工作的网站网络营销的工作内容包括哪些
  • 网站设计技术关键词智能优化排名
  • 市网站开发公司站长之家seo查询官方网站