• 2024-09-142024 CCPC Online
    A(军训I)大分类讨论#pragmaGCCoptimize("O3,unroll-loops")#pragmaGCCtarget("avx2,bmi,bmi2,lzcnt,popcnt")//如果在不支持avx2的平台上将avx2换成avx或SSE之一#include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedef
  • 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-14P10469 后缀数组(Hash+二分)
    #include<bits/stdc++.h>usingnamespacestd;#definexfirst#defineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvector<string>VS;typedefvector<int>
  • 2024-09-13P10468 兔子与兔子(Hash)
    #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-122024.9.12 CF1783 VP
    A:先将\(a\)降序排序,此时只有位置\(2\)有可能不满足条件。找到最小的\(i\ge2\)使得\(a_1\neqa_i\)(不存在则无解),然后交换\(a_2,a_i\),即为一个解。点击查看代码#include<bits/stdc++.h>#defineintlonglong#definepsbkpush_back#definefstfirst#definescdse
  • 2024-09-10模板
    太懒,于是就有了这个博客板子#include<bits/stdc++.h>usingnamespacestd;typedeflonglongll;typedefsigneduns;typedefdoubledob;typedefunsignedlonglongull;#definepir(a,b)pair<a,b>#defineMP(a,b)map<a,b>#defineUMP(a,b
  • 2024-09-09C语言 结构体
    一,什么是结构体结构体(struct)是一种用户用户的定义类型,它允许将多个不同类型的数据组合在一起,形成一个复合的数据类型。结构体通常用于表示一个具有多种属性的实体,例如一个学生的姓名,学号,年龄,成绩等等。在c语言中,结构体的定义通常包括以下几个部分1.名称:结构体标识符,用于引用该结构
  • 2024-09-09小集训 CSP-S 模拟赛
    DAY1A.喜剧的迷人之处在于小思维题不必细讲B.镜中的野兽状压+容斥$gcd(x)+lcm(x)=m$,可以得知$gcd(x)$一定是m的因子,那么就可以枚举$gcd(x)$和$lcm(x)$。对于已经确定的一对$gcd(x)和lcm(x)$,将他们进行质因数分解,写成$\prod{p_{i}^{c_{i}}
  • 2024-09-08AtCoder Beginner Contest 370 A-F题解
    A#include<bits/stdc++.h>usingnamespacestd;typedeflonglongll;mt19937rnd(time(0));#defineintlonglongtypedeftuple<int,int,int>tp;#definexfirst#defineysecondtypedefpair<int,int>pii;typedefpair<double,double>
  • 2024-09-07[luoguAT_abc369_e] Sight[luoguAT_abc369_e]Sightseeing Tour
    题意给定一个包含\(N\)个点和\(M\)条无向边的带权图,保证图中没有自环,但可能包含重边。给出\(Q\)次查询,每次查询给出\(K\)条边\(B_1,B_2,\cdots,B_K\),要求求出从节点\(1\)到节点\(N\)且这\(K\)条边都至少经过一次的最短路(经过边的方向和顺序任意)。赛时Dijkstra
  • 2024-09-062024.9.6 CF1307 模拟赛记录
    A:各捆干草间互相独立,所以优先移动距\(1\)近的。点击查看代码#include<bits/stdc++.h>#defineintlonglong#definepsbkpush_back#definefstfirst#definescdsecond#defineumapunordered_map#definepqueuepriority_queue#definevcvector#defineendl'\n'
  • 2024-09-05Codeforces Round 968 (Div. 2)
    Preface今天课比较少,就抽点时间补一下之前欠的CF这场总体来说题还算简单,E1之前的题基本都是一眼,不过E2没往转化到区间不交的情况想,F更是完全没想到colorcoding,只能说太菜太菜A.TurtleandGoodStrings不难发现只要比较开头和结尾的字符是否相同即可#include<cstdio
  • 2024-09-04Codeforces Round 969 (Div. 1)
    Preface暑假最后几天疑似有点摆过头了,训练也没咋训,CF也没咋打这周末就是网络赛了,虽然名额早就满了,但还是得写写题找下手感不然要被学弟暴打了这场由于是Div.1/2分场,补题就只写Div.1的题了A.IrisandGameontheTree首先考虑快速计算一个01串的贡献,不难发现一段相
  • 2024-09-04GPIOMode_TypeDef 学习备注
    学习STM32——当需要用的GPIO引脚的时候往往要进行GPIO初始化,配置GPIO结构体函数。   GPIO初始化:   GPIO_InitTypeDefGPIO_InitStructure;              //定义结构体变量     GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;