vx
  • 2024-10-022024 ICPC Online 第二场(K)
    #pragmaGCCoptimize("O3,unroll-loops")//#pragmaGCCtarget("avx2,bmi,bmi2,lzcnt,popcnt")//如果在不支持avx2的平台上将avx2换成avx或SSE之一#include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int
  • 2024-10-01[Violet] 蒲公英(分块)
    区间众数要求即有次数又要数字最小#include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedef
  • 2024-09-29食物链(并查集)
    一开始默认为0,如果有捕食关系调整d[x]#include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;ty
  • 2024-09-29[CEOI1999] Parity Game(并查集)
    方法1:带权路径维护本题核心:[a,b]之间有奇数个1转换为s[a-1]^s[b]=1,从而转向并查集#include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedint
  • 2024-09-29Supermarket(并查集)
    考虑利润从高到底排序,优先把利润最高的填到最接近过期的空余位置贪心证明:如果当前a[i]被填入而填入了比最靠近过期前面的位置显然不会更优,如果没有被填入而放了另一组方案利润更大,则把属于a[i]的位置换成a[i]一定更优,两者矛盾#include<bits/stdc++.h>usingnamespacestd;#def
  • 2024-09-29P1955 [NOI2015] 程序自动分析(并查集)
    相等放并查集里,不等直接判断#include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefv
  • 2024-09-14P4551 最长异或路径(树上前缀异或01-trie)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-14P10471 最大异或对 The XOR Largest Pair(01trie)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-14P10470 前缀统计(trie树)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-14PERIOD - Period(kmp求border)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13P10467 [CCC 2007] Snowflake Snow Snowflakes(Hash)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13P1168 中位数(对顶堆)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13P10466 邻值查找
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13P1115 最大子段和(DP)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13Team Queue(队列)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13P2201 数列编辑器(对顶栈)
    include<bits/stdc++.h>usingnamespacestd;definexfirstdefineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvectorVS;typedefvectorVI;typedefvector<vect
  • 2024-09-13P1044 [NOIP2003 普及组] 栈
    include<bits/stdc++.h>usingnamespacestd;definexfirstdefineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvectorVS;typedefvectorVI;typedefvector<vect
  • 2024-09-13HISTOGRA - 最大矩形面积(单调栈)
    include<bits/stdc++.h>usingnamespacestd;definexfirstdefineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvectorVS;typedefvectorVI;typedefvector<vect
  • 2024-09-09openVX加速-新增自定义节点和示例代码
    在OpenVX中添加自定义节点大概通过以下步骤实现:定义自定义节点的计算逻辑:你需要编写一个C函数来实现自定义的图像处理操作。创建自定义节点:通过定义一个自定义节点核(kernel),并将其注册到OpenVX上下文中。在图中使用自定义节点:使用你定义的节点与OpenVX提供的内
  • 2024-09-06根据点坐标X,Y,Z和方向向量Vx,Vy,Vz绘制射线簇
    根据点坐标X,Y,Z和方向向量Vx,Vy,Vz绘制射线簇1.数据导入paraview可以直接导入以逗号分隔的txt或csv数据,但无法自动识别,需要使用过滤器转为paraview可以操作的数组。以下是以空格分隔的txt数据为例,paraview5.11.1版本。数据的存储格式如下图所示,以空格隔开。x,y,z为点的空间坐标,vx,v
  • 2024-09-05【自动驾驶】控制算法(八)横向控制Ⅰ | 算法与流程
    写在前面:
  • 2024-08-27扫描线
    引入扫描线一般运用在图形上面,它和它的字面意思十分相似,就是一条线在整个图上扫来扫去,它一般被用来解决图形面积,周长,以及二维数点等问题。Atlantis问题题意在二维坐标系上,给出多个矩形的左下以及右上坐标,求出所有矩形构成的图形的面积。解法根据图片可知总面积可以直接暴力
  • 2024-08-24区间众数(分块)
    题目描述给定一个序列\(a_1,a_2,\dots,a_n\),\(m\)个询问。每个询问指定一个区间\([l,r]\),你需要输出\(a_l,a_{l+1},\dots,a_r\)这些数字里出现次数最多的数的出现次数。输入第一行一个整数\(T(1\leqT\leq6)\),表示测试数据的组数。每组数据第一行两个数\(n,m(1\leqn,m\leq
  • 2024-08-21图像直方图比较
    对于直方图的比较,我们可以使用OpenCV提供的函数compareHist()进行比较,从而得到一个数值,表示两个直方图的匹配程度(相似性)。原理对于两个直方图(H1
  • 2024-08-04Central Collision
      importturtleimportmathfromrandomimportuniformfromdataclassesimportdataclassWIDTH=1200HEIGHT=800MIN_V=5MAX_V=15MIN_SIZE_FACTOR=0.7MAX_SIZE_FACTOR=4START_DISTANCE=600R=10MARGIN=50SLEEP_MS=20@dataclassclas