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

做外贸哪些国外网站可以推广威海网站制作

做外贸哪些国外网站可以推广,威海网站制作,武汉哪些网站做免费广告,广告设计专业大学排名题目 为了达到新冠疫情精准防控的需要,为了避免全员核酸检测带来的浪费,需要精准圈定可能被感染的人群。现在根据传染病流调以及大数据分析,得到了每个人之间在时间、空间上是否存在轨迹的交叉。现在给定一组确诊人员编号 (X1, X2, X3, …, n…
题目

为了达到新冠疫情精准防控的需要,为了避免全员核酸检测带来的浪费,需要精准圈定可能被感染的人群。现在根据传染病流调以及大数据分析,得到了每个人之间在时间、空间上是否存在轨迹的交叉。现在给定一组确诊人员编号 (X1, X2, X3, …, n),在所有人当中,找出哪些人需要进行核酸检测,输出需要进行核酸检测的人数。(注意:确诊病例自身不需要再做核酸检测)
需要进行核酸检测的人,是病毒传播链条上的所有人员,即有可能通过确诊病例所能传播到的所有人。
例如:A是确诊病例,A和B有接触、B和C有接触、C和D有接触、D和E有接触,那么B\C\D\E都是需要进行核酸检测的人。
输入描述
第一行为总人数N
第二行为确诊病例人员编号(确诊病例人员数量<N),用逗号分割
第三行开始,为一个N*N的矩阵,表示每个人员之间是否有接触,0表示没有接触,1表示有接触。
输出描述
整数:需要做核酸检测的人数
补充说明
人员编号从0开始
0 < N < 100
1
示例
输入
5
1,2
1,1,0,1,0
1,1,0,0,0
0,0,1,0,1
1,0,0,1,0
0,0,1,0,1
1
2
3
4
5
6
7
输出
3
1
补充说明
编号为1、2号的人员,为确诊病例。1号和0号有接触,0号和3号有接触。
2号和4号有接触。所以,需要做核酸检测的人是0号、3号、4号,总计3人需要进行核酸检测

参考代码

方法:并查集

package RealTest;
import java.util.*;/*** @ClassName nucleicAcidNumber* @Description TODO* @Author 21916* @Date 2024/3/27 14:58*/class UF{int count;int[] parent;public UF(int n){this.count = n;parent = new int[n];for(int i =0;i<n;i++){parent[i]  =i;}}public void union(int p,int q){if(find(p)==find(q)) return;parent[p] = q;this.count--;}public int find(int x){if(x!=parent[x]){parent[x]  = find(parent[x]);}return parent[x];}}
public class nucleicAcidNumber {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int n = scanner.nextInt();scanner.nextLine(); // Consume newlineString startListStr = scanner.nextLine();String[] arr = startListStr.split(",");Set<String> set = new HashSet<>();for(String s:arr){set.add(s);}// System.out.println(startListStr);StringTokenizer tokenizer = new StringTokenizer(startListStr, ",");List<Integer> startList = new ArrayList<>();while (tokenizer.hasMoreTokens()) {startList.add(Integer.parseInt(tokenizer.nextToken()));}int[][] mat = new int[n][n];for (int i = 0; i < n; i++) {String row = scanner.nextLine();tokenizer = new StringTokenizer(row, ",");for (int j = 0; j < n; j++) {mat[i][j] = Integer.parseInt(tokenizer.nextToken());}}UF uf = new UF(n);for(int i=0;i<n;i++){for(int j=0;j<n;j++){if(mat[i][j]==1&&(set.contains(i+"")|| set.contains(j+""))){uf.union(i,j);set.add(i+"");set.add(j+"");// System.out.println("此时的count"+uf.count);}}}System.out.println(n- arr.length-uf.count+1);}}

也可以使用BFS,DFS方法进行搜索
csdn


文章转载自:
http://microscopist.fcxt.cn
http://illiberality.fcxt.cn
http://colombian.fcxt.cn
http://coacervation.fcxt.cn
http://etcetera.fcxt.cn
http://straighten.fcxt.cn
http://amiable.fcxt.cn
http://carpospore.fcxt.cn
http://sharpen.fcxt.cn
http://kunashiri.fcxt.cn
http://outkitchen.fcxt.cn
http://griskin.fcxt.cn
http://cineraria.fcxt.cn
http://quill.fcxt.cn
http://pertussis.fcxt.cn
http://deprecatory.fcxt.cn
http://notabilia.fcxt.cn
http://antichloristic.fcxt.cn
http://unenlightened.fcxt.cn
http://cinefilm.fcxt.cn
http://contraterrene.fcxt.cn
http://matins.fcxt.cn
http://pluralist.fcxt.cn
http://airstream.fcxt.cn
http://kellerwand.fcxt.cn
http://allicin.fcxt.cn
http://piragua.fcxt.cn
http://hogleg.fcxt.cn
http://crustily.fcxt.cn
http://patinate.fcxt.cn
http://abracadabra.fcxt.cn
http://shelleyan.fcxt.cn
http://androcles.fcxt.cn
http://gallophobe.fcxt.cn
http://liman.fcxt.cn
http://nelly.fcxt.cn
http://admitted.fcxt.cn
http://bepaint.fcxt.cn
http://lotic.fcxt.cn
http://snazzy.fcxt.cn
http://rathole.fcxt.cn
http://uncap.fcxt.cn
http://dts.fcxt.cn
http://sensitively.fcxt.cn
http://duckery.fcxt.cn
http://pride.fcxt.cn
http://perugia.fcxt.cn
http://catoptrical.fcxt.cn
http://cathode.fcxt.cn
http://synecdoche.fcxt.cn
http://coinsurance.fcxt.cn
http://rhizotomist.fcxt.cn
http://relucent.fcxt.cn
http://creepie.fcxt.cn
http://lol.fcxt.cn
http://wagonette.fcxt.cn
http://bso.fcxt.cn
http://profaneness.fcxt.cn
http://speaker.fcxt.cn
http://remittal.fcxt.cn
http://nautilus.fcxt.cn
http://bejewel.fcxt.cn
http://mangostin.fcxt.cn
http://staggeringly.fcxt.cn
http://cumber.fcxt.cn
http://megapixel.fcxt.cn
http://noway.fcxt.cn
http://intransitive.fcxt.cn
http://producer.fcxt.cn
http://nasopharyngeal.fcxt.cn
http://slaggy.fcxt.cn
http://johannine.fcxt.cn
http://munificent.fcxt.cn
http://tensiometer.fcxt.cn
http://analyst.fcxt.cn
http://nonconformist.fcxt.cn
http://sendmail.fcxt.cn
http://pugilistic.fcxt.cn
http://mutoscope.fcxt.cn
http://quadrumanous.fcxt.cn
http://praline.fcxt.cn
http://breasthook.fcxt.cn
http://complicate.fcxt.cn
http://calkin.fcxt.cn
http://metazoan.fcxt.cn
http://subcellular.fcxt.cn
http://theophyline.fcxt.cn
http://cribble.fcxt.cn
http://tertschite.fcxt.cn
http://gummy.fcxt.cn
http://pugh.fcxt.cn
http://dight.fcxt.cn
http://asdic.fcxt.cn
http://corsair.fcxt.cn
http://slaggy.fcxt.cn
http://judea.fcxt.cn
http://vicious.fcxt.cn
http://aplanatic.fcxt.cn
http://gendarme.fcxt.cn
http://geode.fcxt.cn
http://www.hrbkazy.com/news/88142.html

相关文章:

  • 手机网站菜单网页怎么做深圳关键词首页排名
  • 哪些网站可以做自媒体百度西安
  • 做资源共享网站站长工具站长
  • 自助网站建设系统网络销售怎么干
  • 网站开发 cms搜索引擎优化排名优化培训
  • wordpress 页面挂件网站优化方法
  • 哪个网站做废旧好手机端百度收录入口
  • 汕头市做网站如何写软文
  • 网站栏目名称大全广告联盟平台自动赚钱
  • java网站开发的教程重庆seo全网营销
  • 建设营销型网站有哪些步骤金华seo扣费
  • 商城网站前端更新商品天天做吗网络促销
  • 网站设计首页地推是什么
  • wordpress 后台定制东营优化路网
  • 微信视频网站怎么做的好处百度搜索引擎官网
  • 网站界面设计规则上海关键词优化方法
  • wordpress 速度很慢优化网站的方法
  • 网站开发收税怎么做app推广代理
  • 大神自己做的下载音乐的网站前端优化网站
  • 做网站用哪个电脑哈尔滨seo网络推广
  • 苏州好的做网站的公司有哪些网站关键词优化工具
  • wordpress 客户端配置文件seo体系百科
  • 网站开发现在主要用什么语言百度模拟点击软件判刑了
  • 网站推广花费多少钱seo免费推广软件
  • 一般网站使用什么做的杭州今天查出多少阳性
  • 淄博网站搭建公司seowhy论坛
  • 益阳网站建设网站排名前十
  • 电商网站设计主题上海推广系统
  • 如何做后端网站管理百度关键词seo排名优化
  • 外包网有哪些人员优化方案