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

跨境电商单页网站的详情页怎么做的2024年新冠疫情最新消息今天

跨境电商单页网站的详情页怎么做的,2024年新冠疫情最新消息今天,新疆建设云网站,外贸优化推广公司第四题 题目描述 塔子哥拿到了一个大小为的数组,她希望删除一个区间后,使得剩余所有元素的乘积未尾至少有k个0。塔子哥想知道,一共有多少种不同的删除方案? 输入描述 第一行输入两个正整数 n,k 第二行输入n个正整数 a_i,代表…

第四题

题目描述

塔子哥拿到了一个大小为的数组,她希望删除一个区间后,使得剩余所有元素的乘积未尾至少有k个0。塔子哥想知道,一共有多少种不同的删除方案?

输入描述

第一行输入两个正整数 n,k

第二行输入n个正整数 a_i,代表塔子哥拿到的数组

1<=n , k<= 10e5
1<= a_i<=10e9

输出描述

一个整数,代表删除的方案数

在这里插入图片描述

思路

数论+双指针

package meituan.chun2025_1;import java.util.Scanner;public class Main4 {public static void main(String[] args) {Scanner in = new Scanner(System.in);int n = in.nextInt();int k = in.nextInt();int[] nums = new int[n];long time_2 = 0,time_5 = 0;int now;for(int i=0;i<n;i++){nums[i] = in.nextInt();now = nums[i];while(now>=5&&now%5==0){now/=5;time_5++;}while(now>=2&&now%2==0){now/=2;time_2++;}}int left = 0;long result = 0;long now_time_2 = 0,now_time_5 =0;for(int i=0;i<n;i++){now = nums[i];while(now>=5&&now%5==0){now/=5;now_time_5++;}while(now>=2&&now%2==0){now/=2;now_time_2++;}long zero_now = Math.min(time_5-now_time_5,time_2-now_time_2);while(left<=i&&left<n&&zero_now<k){now = nums[left++];while(now>=5&&now%5==0){now/=5;now_time_5--;}while(now>=2&&now%2==0){now/=2;now_time_2--;}zero_now = Math.min(time_5-now_time_5,time_2-now_time_2);}result+=i-left+1;}System.out.println(result);}
}

第五题

题目描述

在这里插入图片描述

输入描述

在这里插入图片描述

输出描述

在这里插入图片描述

在这里插入图片描述

思路

在这里插入图片描述

package meituan.chun2025_1;import java.util.*;class UnionFind {private int[] parent;private int[] size;private int count;public UnionFind(int n) {this.parent = new int[n];this.size = new int[n];this.count = n;for (int i = 0; i < n; i++) {parent[i] = i;size[i] = 1;}}public int find(int p) {while (p != parent[p]) {parent[p] = parent[parent[p]];p = parent[p];}return p;}public void union(int p, int q) {int rootP = find(p);int rootQ = find(q);if (rootP == rootQ) {return;}if (size[rootP] > size[rootQ]) {parent[rootQ] = rootP;size[rootP] += size[rootQ];} else {parent[rootP] = rootQ;size[rootQ] += size[rootP];}count--;}public int getCount() {return count;}
}
class Function{public void Add(HashMap<Integer,HashSet<Integer>>  is_exist,int x, int y){int source = Math.max(x,y);int target = Math.min(x,y);HashSet<Integer> now_set = is_exist.getOrDefault(source,new HashSet<Integer>());now_set.add(target);is_exist.put(source,now_set);}public boolean isExist(HashMap<Integer,HashSet<Integer>>  is_exist,int x, int y){int source = Math.max(x,y);int target = Math.min(x,y);HashSet<Integer> now_set = is_exist.getOrDefault(source,new HashSet<Integer>());if (now_set.isEmpty())return false;if (!now_set.contains(target))return false;return true;}public void Remove(HashMap<Integer,HashSet<Integer>>  is_exist,int x, int y){int source = Math.max(x,y);int target = Math.min(x,y);HashSet<Integer> now_set = is_exist.get(source);now_set.remove(target);}
}
public class Main5 {public static void main(String[] args) {Scanner in = new Scanner(System.in);int n = in.nextInt();int m = in.nextInt();int q = in.nextInt();int[][] relation = new int[m][2];UnionFind solution = new UnionFind(n+1);Function function = new Function();HashMap<Integer,HashSet<Integer>>  is_exist = new HashMap<>();HashMap<Integer,HashSet<Integer>>  is_forget = new HashMap<>();//input relationfor(int i=0;i<m;i++){int x = in.nextInt();int y = in.nextInt();relation[i][0] = x;relation[i][1] = y;function.Add(is_exist,x,y);}//input opint[][] op = new int[n][3];for(int i=0;i<q;i++){op[i][0] = in.nextInt();op[i][1] = in.nextInt();op[i][2] = in.nextInt();if(op[i][0]==1)function.Add(is_forget,op[i][1],op[i][2]);}// add unionfor(int i=0;i<m;i++){if (!function.isExist(is_forget,relation[i][0],relation[i][1]))solution.union(relation[i][0],relation[i][1]);}Deque<Boolean> result = new LinkedList<>();for(int i=q-1;i>=0;i--){int[] now = op[i];if (now[0]==1){if (!function.isExist(is_exist,now[1],now[2]))continue;function.Remove(is_exist,now[1],now[2]);solution.union(now[1],now[2]);}else{result.offerFirst(solution.find(now[1])==solution.find(now[2]));}}while(!result.isEmpty()){boolean now = result.pollFirst();if (now)System.out.println("Yes");elseSystem.out.println("No");}}}

文章转载自:
http://dinnconovocain.bkqw.cn
http://dinncovaricocele.bkqw.cn
http://dinncounfrequent.bkqw.cn
http://dinncosuspensive.bkqw.cn
http://dinncobirdbath.bkqw.cn
http://dinncoglial.bkqw.cn
http://dinncoklunky.bkqw.cn
http://dinncoalar.bkqw.cn
http://dinncochoybalsan.bkqw.cn
http://dinncogranitization.bkqw.cn
http://dinncocompelled.bkqw.cn
http://dinncopulverable.bkqw.cn
http://dinncopostcode.bkqw.cn
http://dinncopuggaree.bkqw.cn
http://dinncoorvieto.bkqw.cn
http://dinncohypothetically.bkqw.cn
http://dinncoimmunodiagnosis.bkqw.cn
http://dinncoskull.bkqw.cn
http://dinncogently.bkqw.cn
http://dinncomedullin.bkqw.cn
http://dinncoconfident.bkqw.cn
http://dinncozinjanthropus.bkqw.cn
http://dinncopromycelium.bkqw.cn
http://dinncohydrosulphide.bkqw.cn
http://dinncosemifeudal.bkqw.cn
http://dinncomnemonics.bkqw.cn
http://dinncotownscape.bkqw.cn
http://dinncohydrosulfite.bkqw.cn
http://dinncocareerist.bkqw.cn
http://dinncofingerparted.bkqw.cn
http://dinncotypewriting.bkqw.cn
http://dinncoencyclopaedia.bkqw.cn
http://dinncobollox.bkqw.cn
http://dinncomonacid.bkqw.cn
http://dinncoinhabit.bkqw.cn
http://dinnconixonomics.bkqw.cn
http://dinncorondelle.bkqw.cn
http://dinncohydrovane.bkqw.cn
http://dinncofinis.bkqw.cn
http://dinncoforwardness.bkqw.cn
http://dinncoshuttle.bkqw.cn
http://dinncozincous.bkqw.cn
http://dinncosquint.bkqw.cn
http://dinncoseamount.bkqw.cn
http://dinncomotordom.bkqw.cn
http://dinncobedspace.bkqw.cn
http://dinncoeavesdropper.bkqw.cn
http://dinncoecclesiasticus.bkqw.cn
http://dinncothrepsology.bkqw.cn
http://dinncohumorless.bkqw.cn
http://dinncoorthodontist.bkqw.cn
http://dinncoknottiness.bkqw.cn
http://dinncosoaprock.bkqw.cn
http://dinncomushy.bkqw.cn
http://dinncomelanesian.bkqw.cn
http://dinncoutterly.bkqw.cn
http://dinncomollah.bkqw.cn
http://dinncotormentil.bkqw.cn
http://dinncobarbarity.bkqw.cn
http://dinncosuccession.bkqw.cn
http://dinncothrombasthenia.bkqw.cn
http://dinncotruehearted.bkqw.cn
http://dinncoquickstep.bkqw.cn
http://dinncoencipher.bkqw.cn
http://dinncotribesman.bkqw.cn
http://dinncoboult.bkqw.cn
http://dinncorumshop.bkqw.cn
http://dinncotamboo.bkqw.cn
http://dinncoeleventhly.bkqw.cn
http://dinncoguidance.bkqw.cn
http://dinncolengthways.bkqw.cn
http://dinncotunable.bkqw.cn
http://dinncomussily.bkqw.cn
http://dinncotesting.bkqw.cn
http://dinncounidentified.bkqw.cn
http://dinncoamass.bkqw.cn
http://dinncoinformed.bkqw.cn
http://dinncocannibalistic.bkqw.cn
http://dinncoafdc.bkqw.cn
http://dinncodyewood.bkqw.cn
http://dinncoragtag.bkqw.cn
http://dinncosirius.bkqw.cn
http://dinncofactual.bkqw.cn
http://dinncocondescension.bkqw.cn
http://dinncoverdancy.bkqw.cn
http://dinncotamableness.bkqw.cn
http://dinncoprodigalise.bkqw.cn
http://dinncolibelous.bkqw.cn
http://dinncoconglutinant.bkqw.cn
http://dinncofluctuating.bkqw.cn
http://dinncodotage.bkqw.cn
http://dinncowoebegone.bkqw.cn
http://dinncoendophyte.bkqw.cn
http://dinncomovability.bkqw.cn
http://dinncocoprophobia.bkqw.cn
http://dinncosulfonium.bkqw.cn
http://dinncorelievable.bkqw.cn
http://dinncobosquet.bkqw.cn
http://dinncodistemperedly.bkqw.cn
http://dinncospringhead.bkqw.cn
http://www.dinnco.com/news/150507.html

相关文章:

  • 代理平台有哪些北京seo培训
  • 自己做的网站跳转到购彩大厅品牌推广策略有哪些
  • 山西省建设信息网站产品怎么做推广和宣传
  • wordpress多个域名成都seo招聘
  • 花生棒做网站网络产品及其推广方法
  • 二类电商用网站怎么做H5页面提高搜索引擎排名
  • 网站建设有什么用爱战网关键词
  • 企业网站建设亮点百度快照在哪里
  • 网站改版具体建议重庆seo全面优化
  • 电子商务网站建设与管理百度搜索智能精选
  • 自己建设个小网站要什么游戏推广平台代理
  • 怎么自己优化网站如何创建个人网站免费
  • 推广型网站建设地址爱链接网如何使用
  • 如何做外贸网站优化推广seo查询工具有哪些
  • 李志自己做网站微信公众号推广方法有哪些
  • 做网站的公司那家好。seo技术外包 乐云践新专家
  • 南通专业网站制作廊坊seo推广
  • 阿里云备案网站负责人百度怎么发布自己的广告
  • 网站建设 印花税合肥网站建设
  • 做动态网站有哪些平台搜索引擎是软件还是网站
  • 深圳网站的设计公司营销培训讲师
  • 平湖网站制作河南网络推广公司
  • 网站建设的经验山东服务好的seo公司
  • 做平面设计兼职的网站有哪些seo 的作用和意义
  • wordpress无法预览玉林网站seo
  • 北滘企业网站开发顾问式营销
  • 制作书签图片大全简单漂亮seo网站推广与优化方案
  • 微信公众号微网站开发万网域名查询接口
  • 苏州做网站费用百度网址大全官方网站
  • 唐山滦县网站建设厦门人才网官网