02 2024 档案
发表于 2024-02-28 21:32阅读:57评论:0推荐:0
摘要:int id(int x,int y,int m){ //m列 return m*(x-1)+y; } pii rid(int u,int m){ int x=(u+m-1)/m;//m列 int y=u%m;if(y==0)y+=m; return make_pair(x,y); }
阅读全文 »
发表于 2024-02-22 19:01阅读:11评论:0推荐:0
摘要:inline void read(__int128 &x) { x=0; int f=1;//判断正负 char ch=getchar();//读入字符 while(ch<'0'||ch>'9') { if(ch=='-') f=-1; ch=getchar(); } while(ch>='0'&&
阅读全文 »
发表于 2024-02-01 22:07阅读:74评论:0推荐:0
摘要:三分法是二分法的变种,他最基本的用途是求单峰函数的极值点。 三分适用的情况:有唯一的最大值,满足最大值左侧严格单调递增,右侧严格单调递减(或左减右增)。强调严格单调,这样在确定最值是才能判断最值的位置,否则三分法不能缩小左右边界。 三分整数模板 整数的三分可能具有不确定性,可以通过改变while循环
阅读全文 »