09 2024 档案

摘要:最小圆覆盖问题是什么呢?就是指在二维平面上有一堆点,然后我们要求一个最小半径的圆能够将所有点全部都包住,这就是最小圆覆盖问题。 最小覆盖圆的性质 性质1:最小覆盖圆是唯一的 证明:我们假设有两个圆O1,O2,他们半径都是r,都是最小覆盖圆,那么所有的点一定在两圆的交集部分。那我们以两圆交集部分的弦长 阅读全文
posted @ 2024-09-20 09:24 yzc_is_SadBee 阅读(34) 评论(0) 推荐(0) 编辑
摘要:写这玩意的原因是初赛做到了 SadBee csdn 第一部分:DLX算法的提出 1.1一类被称为精确覆盖的问题 在计算机科学中,精确覆盖问题指找出这样的一种覆盖,或证明其不存在。 满足以下条件的集合为一个精确覆盖: S*中任意两个集合没有交集,即X中的元素在S*中出现最多一次 S*中集合的全集为X, 阅读全文
posted @ 2024-09-20 08:42 yzc_is_SadBee 阅读(14) 评论(0) 推荐(0) 编辑
摘要:小粉兔的楼下 #include<bits/stdc++.h> using namespace std; long long N,Ans=1; long long C,G[50]; long long qPow(long long b,long long e) { long long A=1; for 阅读全文
posted @ 2024-09-19 20:33 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int num[12],len; long long l,r,dp[11][11][11][2][2][2][2]; long long f(int p,int a,int b,bool c,bool d,b 阅读全文
posted @ 2024-09-19 20:00 yzc_is_SadBee 阅读(8) 评论(0) 推荐(0) 编辑
摘要:新鲜出炉的数位dp #include<bits/stdc++.h> using namespace std; long long a,b; long long ten[20],f[20]; long long cnta[20],cntb[20]; void solve(long long x,lon 阅读全文
posted @ 2024-09-19 19:29 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:以下内容摘自OI-Wiki 引子 数位dp是指把一个数字按照个、十、百、千等等一位一位地拆开,关注它每一位上的数字。如果拆的是十进制数,那么每一位数字都是 0~9,其他进制可类比十进制。 数位 DP:用来解决一类特定问题,这种问题比较好辨认,一般具有这几个特征: 要求统计满足一定条件的数的数量(即, 阅读全文
posted @ 2024-09-19 18:57 yzc_is_SadBee 阅读(20) 评论(0) 推荐(0) 编辑
摘要:d_f_s 附赠双倍经验,好耶! 然后爆搜就行 #include<bits/stdc++.h> using namespace std; int T,n,ans,sum[25]; void dfs(int x)//x为出牌次数 { if (x>=ans) return; //顺子 int k=0;/ 阅读全文
posted @ 2024-09-18 20:22 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:摘自: 一看题目,像个搜索 再一看,像个广度优先搜索 既然是BFS,那我们首先要搞出一个(一堆)队列 那问题是队列里咱们存啥呢??? 首先,按照广搜解决“迷宫问题”的国际惯例,肯定要先把坐标和步数存到里面! 可是,这似乎不大够? 因为荆轲还有两种技能:隐身和瞬移。 隐身:balabala…… 瞬移: 阅读全文
posted @ 2024-09-18 19:58 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:不如搜索 折半搜索 第一眼2^40,死的透透滴 所以想到折半 如图: 这是普通搜索: 这是折半搜索: 原谅我图画的丑 所以,我们可以对两边开展搜索 将前一半的搜索状态存入a数组,后一半存入b数组。 排序后mlogm查找即可 #include<bits/stdc++.h> using namespac 阅读全文
posted @ 2024-09-18 19:31 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:good rmq #include<bits/stdc++.h> using namespace std; struct node { int num; int lid,rid; int w; int data; bool operator <(node i)const { return data< 阅读全文
posted @ 2024-09-18 19:07 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:see you again #include<bits/stdc++.h> using namespace std; int n,m,x,y,v,Lok[500010],Rok[500010],Lban[500010],Rban[500010],pre[500010],ans[500010]; bo 阅读全文
posted @ 2024-09-13 20:31 yzc_is_SadBee 阅读(3) 评论(0) 推荐(0) 编辑
摘要:题解 总之,赞美太阳 #include <bits/stdc++.h> using namespace std; inline int read(){ char c;int f=1,res=0; while(c=getchar(),!isdigit(c))if(c=='-')f*=-1; while 阅读全文
posted @ 2024-09-13 20:14 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:题解其1 最终看着写的题解 #include <bits/stdc++.h> using namespace std; inline void read(long long&x){ char c11=getchar();x=0;while(!isdigit(c11))c11=getchar(); w 阅读全文
posted @ 2024-09-13 19:43 yzc_is_SadBee 阅读(4) 评论(0) 推荐(0) 编辑
摘要:treap [详解](https://www.cnblogs.com/fusiwei/p/12884254.html) treap 这里的treap指有旋treap 如何种一棵(香蕉树)有旋treap Treap=Tree+heap。 所以Treap树堆其实就是树+堆。树是二叉查找树BST,堆是二叉 阅读全文
posted @ 2024-09-13 19:14 yzc_is_SadBee 阅读(13) 评论(0) 推荐(0) 编辑
摘要:知道kmp的请跳过这一段 dalao们表示知道思想即可 找到最清晰的解析 kmp 我看了约114514个解析才搞懂 如何求next 首先,next[i]本应表示0~i的字符串的最长相同前缀后缀的长度。 不过为了方便匹配,实际可以存最长相同前缀后缀时前缀最后一个的地址 听起来好绕 那这么说吧: 例如串 阅读全文
posted @ 2024-09-12 20:42 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:你说的对,但是set是一种高效的数据结构,定义于bits/stdc++.h,使用std进行调用…… #include <bits/stdc++.h> using namespace std; const int maxn = 1000000; const int INF = 1e9; int n, 阅读全文
posted @ 2024-09-12 19:35 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:delicious #include<bits/stdc++.h> using namespace std; const int inf=0x3f3f3f3f; multiset<int>delta,full; int st[500100],ed[500100]; int srt=inf; int 阅读全文
posted @ 2024-09-12 19:07 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:( •̀ ω •́ )y 好fan 题解 #include <bits/stdc++.h> using namespace std; inline int read(){ char c;int f=1,res=0; while(c=getchar(),!isdigit(c))if(c=='-')f* 阅读全文
posted @ 2024-09-11 20:35 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:高效高效 分块。 here #include<bits/stdc++.h> using namespace std; int n,a[500010]; double dp[500010],sqr[500010]; double w(int j,int i) { return double(a[j]) 阅读全文
posted @ 2024-09-11 19:57 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:这个故事告诉我们,要全心全意赞美太阳。 题解 #include<bits/stdc++.h> using namespace std; const unsigned long long mod=998244353; struct data { int dp[3][3]; inline int* op 阅读全文
posted @ 2024-09-11 19:29 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:树状数组是个好东西 # include <bits/stdc++.h> # define Fill(a, b) memset(a, b, sizeof(a)) using namespace std; const int _(3e5 + 10), INF(2e9), PF(1e5); inline 阅读全文
posted @ 2024-09-11 18:55 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:概率期望谔谔谔。 #include<bits/stdc++.h> using namespace std; double f[1010][1010]; double g[1010][1010]; double C[1010][1010]; int main() { int n = ri, d = r 阅读全文
posted @ 2024-09-10 20:29 yzc_is_SadBee 阅读(10) 评论(0) 推荐(0) 编辑
摘要:偷懒的新方法 但vector足以 #include<bits/stdc++.h> using namespace std; vector<int>v; inline int read() { char ch=getchar(); int x=0,f=1; for(; !isdigit(ch); ch 阅读全文
posted @ 2024-09-10 19:50 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:才发现蓝题以下的基本都被菜就多练的我刷掉了 from 0pts to 100pts 所以,这道题就是线段树+dp喽 #include<bits/stdc++.h> #define rep(k,l,r) for(long long k=l;k<=r;++k) #define per(k,r,l) fo 阅读全文
posted @ 2024-09-10 19:08 yzc_is_SadBee 阅读(8) 评论(0) 推荐(0) 编辑
摘要:布什各门,阿? 令人惊奇的题解 标程:某个姓组合的数学+高精 here 阅读全文
posted @ 2024-09-09 20:25 yzc_is_SadBee 阅读(4) 评论(0) 推荐(0) 编辑
摘要:dp。 先把这个图像左右反转一下,这样方便dp f[j][i]代表前j列放i个的方案; v[j]代表第j列的高度; f[j][i]=(f[j-1][i]+f[j-1][i-1]*(v[j]-i+1))%mo; 答案就是f[a+c][m] #include<bits/stdc++.h> using n 阅读全文
posted @ 2024-09-09 20:14 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:切水题 没有切day9,10,11是因为泰难辣 #include<bits/stdc++.h> using namespace std; int fn[100001],fg[100001],n,k; int main(){ cin>>n>>k; fn[1]=1;//先赋初值 fg[1]=1; for 阅读全文
posted @ 2024-09-09 20:09 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:高效高效,坚持高效,耶( •̀ ω •́ )y 首先,我们考虑引爆每个炸弹,它能引爆的区间是多少(即:它能对答案做出什么贡献) 易得炸一个=炸这个区间 为什么? 你只要引爆了一个大炸弹(例如沙皇) 它就会把它的左边和右边一起抬走 所以考虑线性维护每个炸弹向左/向右能炸到哪里 代码十分精华: #inc 阅读全文
posted @ 2024-09-09 19:36 yzc_is_SadBee 阅读(14) 评论(0) 推荐(0) 编辑
摘要:今天有点高效啊,切数论题都这样喵? #include<bits/stdc++.h> using namespace std; int main() { int n,a,b,c,d,s,m; cin>>n; while(n--){ cin>>a>>b>>c>>d; m=min(b,d); for(in 阅读全文
posted @ 2024-09-09 19:04 yzc_is_SadBee 阅读(3) 评论(0) 推荐(0) 编辑
摘要:1.逃课做法 第一眼看到: 感觉有点像内啥分解只因数 然后就不会了那我写这个干什么 这时,聪明的我们就想到了打表 怎么打呢? 如图: 我们可以把它分成几个块,提前打好每个块的答案 这样,我们就用普及的算法过了提高的题 壮观的表: 822468118437,……,3289045541824037 2. 阅读全文
posted @ 2024-09-09 18:42 yzc_is_SadBee 阅读(3) 评论(0) 推荐(0) 编辑
摘要:原来可以用分块啊 水灵灵的做法: #include <bits/stdc++.h> using namespace std; int main() { long long n,k; scanf("%lld%lld",&n,&k); long long ans=n*k; for(long long l 阅读全文
posted @ 2024-09-09 18:31 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:首先 Trie树: #include<bits/stdc++.h> using namespace std; int T,q,n,t[3000005][65],cnt[3000005],idx; char s[3000005]; int getnum(char x){ if(x>='A'&&x<=' 阅读全文
posted @ 2024-09-05 20:03 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑
摘要:还是rmq. 原来如此 代码: #include <bits/stdc++.h> using namespace std; const int N=1e5+7; int a[N],b[N],rmq[N][20]; int pw(int k){ int res=1; while(k--) res*=2 阅读全文
posted @ 2024-09-05 19:34 yzc_is_SadBee 阅读(4) 评论(0) 推荐(0) 编辑
摘要:这是rmq 半懂不懂(因为已经会线段树了) 但是!它的代码真的好短啊啊啊啊啊! #include <bits/stdc++.h> using namespace std; int dp1[500010][20],dp2[500010][20],w[1000010]; int main(){ int 阅读全文
posted @ 2024-09-05 19:08 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:题解 题意:题面很臭很长。大意是,有一个大小为N的环,给出M,K,D,以及N个数。我们进行K次操作,每次操作把距离当前点不超过D的累加到当前点,结果模M。 思路:因为要进行K次,每次的原则是一样的,我们可以想到用矩阵来优化,如果i能到达j,把么base[i][j]=1;则结果ans=A(base^K 阅读全文
posted @ 2024-09-05 18:32 yzc_is_SadBee 阅读(5) 评论(0) 推荐(0) 编辑
摘要:题解 阅读全文
posted @ 2024-09-04 20:22 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:我了个半平面交 复杂的题解QAQ 代码不贴了,跟题解大同小异…… 于是我们用大量题解水过了所有项目(基本1~3题) 阅读全文
posted @ 2024-09-04 20:05 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:对于操作来说,第一次是最重要的,后来每次倒入水量是相同的。 这是因为后面的总液体量不变的情况下, ans=第一次后液体浓度*后几次液体浓度的积 所以由1/v^2 < 1/v^2 - x^2(v,x>0),易得后几次水量相同 那么,对于第一次来说可以用三分法来求极值。 代码: #include <bi 阅读全文
posted @ 2024-09-04 19:36 yzc_is_SadBee 阅读(10) 评论(0) 推荐(0) 编辑
摘要:题解告诉我: 大意:在一个矩形区域内,有n条线段,线段的端点是在矩形边上的,有一个特殊点,问从这个点到矩形边的最少经过的线段条数最少的书目,穿越只能在中点穿越 思路:需要巧妙的转换一下这个问题,因为从一个点到终点不可能“绕过”围墙,只能穿过去,所以门是否开在中点是无所谓的,只要求四周线段中点到终点的 阅读全文
posted @ 2024-09-04 19:11 yzc_is_SadBee 阅读(4) 评论(0) 推荐(0) 编辑
摘要:他说:O(n^3)是过不了滴 一搜…… 6 代码和题解没有实质区别: #include<cstdio> #include<ctime> #include<cstdlib> using namespace std; int a[505][505],b[505][505],c[505][505]; in 阅读全文
posted @ 2024-09-04 18:49 yzc_is_SadBee 阅读(3) 评论(0) 推荐(0) 编辑
摘要:玩不动了,这是题解,再见! 阅读全文
posted @ 2024-09-03 19:54 yzc_is_SadBee 阅读(2) 评论(0) 推荐(0) 编辑
摘要:第一次做扫描线 挺好的 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct ppx { int l,r; double left,right; double len; int cover 阅读全文
posted @ 2024-09-03 19:34 yzc_is_SadBee 阅读(8) 评论(0) 推荐(0) 编辑
摘要:先把蜂巢快递柜画出来: __ __ __ __ __/ \__/ \__/ \__/ \__ __/ \__/ \__/53\__/ \__/ \__ / \__/ \__/52\__/54\__/ \__/ \ \__/ \__/51\__/31\__/55\__/ \__/ / \__/50\_ 阅读全文
posted @ 2024-09-03 19:08 yzc_is_SadBee 阅读(6) 评论(0) 推荐(0) 编辑
摘要:原来是二分 谁对平均分贡献大选谁 界限<0.001,100次足矣 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=1010; i 阅读全文
posted @ 2024-09-03 18:33 yzc_is_SadBee 阅读(3) 评论(0) 推荐(0) 编辑
摘要:概率题。 1:爆枚 本蒟蒻不会概率dp,于是手搓枚举。 大抵是这么枚的: 如果区间里有它,好办,只能它赢 没他呢?就只能分类讨论。 中道崩殂的代码: #include<iostream> #include<vector> #include<string.h> using namespace std; 阅读全文
posted @ 2024-09-02 19:03 yzc_is_SadBee 阅读(8) 评论(0) 推荐(0) 编辑
摘要:Gcd 板子。 注意“同一直线”,除2即可 #include<iostream> using namespace std; int Gcd(int a,int b){ int c; while(a){ c=b%a; b=a; a=c; } return b; } int main(){ int n, 阅读全文
posted @ 2024-09-02 18:40 yzc_is_SadBee 阅读(7) 评论(0) 推荐(0) 编辑