一、理论 并查集的定义: 并查集是一种树型的数据结构,用于处理一些不交集的合并和查询问题。一般用数组实现。 Find:确定元素属于哪一个子集,它可以被用来确定两个元素是否属于同一个子集。 Union:将两个子集合并成同一个集合。 并查集的优化: 优化1: 降低rank,提高查询效率。合并时要考虑ra ...
分类:
其他好文 时间:
2020-12-04 11:19:39
阅读次数:
6
code import multiprocessing from multiprocessing import Pool,Queue import time import threading import gevent from gevent import monkey monkey.patch_a ...
分类:
编程语言 时间:
2020-12-04 10:52:40
阅读次数:
6
function [T]=bianjie(a,b) x=a'; y=b'; j=1; ind_maxx=find(x==max(x)); ind_minx=find(x==min(x)); for i=unique(x) %获得x的不同值 if i==min(x) y1=y(ind_minx); % ...
分类:
其他好文 时间:
2020-12-03 12:18:59
阅读次数:
5
1.获取当前页面的url方法:current_url 实例:driver.current_url 2.获取元素坐标方法:location解释:首先查找到你要获取元素的,然后调用location方法实例:driver.find_element_by_xpath("xpath").location 3. ...
分类:
其他好文 时间:
2020-12-03 12:10:18
阅读次数:
7
#include<iostream> #include<cstring> using namespace std; int len; void getNext(char *s, int *nex) { nex[0] = -1; int i = 0, j = -1; while(i < len) { ...
分类:
其他好文 时间:
2020-12-01 12:21:17
阅读次数:
7
1.MySQL自定义排序函数FIELD() order by FIELD(a.status,3,2,4,1) 按照3,2,4,1 排序 显示 2. FIND_IN_SET(a.name, "a,b,c,d") 判断a.name 是否在 "a,b,c,d" 中 ,判断时 "a,b,c,d" 用逗号分割 ...
分类:
数据库 时间:
2020-12-01 12:11:01
阅读次数:
11
1.查找文件 find / -name filename.txt 根据名称查找/目录下的filename.txt文件。 2.查看一个程序是否运行 ps –ef|grep tomcat 查看所有有关tomcat的进程 3.终止线程 kill -9 19979 终止线程号位19979的线程 4.查看文件 ...
分类:
系统相关 时间:
2020-11-30 16:04:26
阅读次数:
20
Sumdiv Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 37483 Accepted: 9161 Description Consider two natural numbers A and B. Let S be the ...
分类:
其他好文 时间:
2020-11-27 11:53:21
阅读次数:
25
包络面绘制程序 function [X,Y,Z]=Enveloping_surface_rendering(x,y,z,a,b,A1) s=A1(:,3); b=[find(diff(s));length(s)]; c=b-[0;b(1:end-1)]; out=mat2cell(A1,c); ct ...
分类:
其他好文 时间:
2020-11-27 11:47:26
阅读次数:
23
###题目 1160. Find Words That Can Be Formed by Characters ###解题方法 先把可使用的所有字符放入字典charscount,以“字符:可出现次数”的形式存放,然后遍历words中的每个单词,初始化tempcount字典为charscount的副本 ...
分类:
其他好文 时间:
2020-11-27 11:39:59
阅读次数:
10