Hi, Friend!

You got to put the past behind you before you can move on.

  • undefined

    随笔分类 -  ACM板子

    总结一些ACM常见算法模板
    摘要:mod为模数,maxn为最大值 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9+7; const int maxn = 2e6+5; ll fac[maxn],inv[max 阅读全文
    posted @ 2022-03-06 15:35 云憩风霞 阅读(136) 评论(0) 推荐(0) 编辑
    摘要:#include<bits/stdc++.h> using namespace std; const int maxm=4e5+10; const int maxn=2e5+10; struct node{ int u,v,w; bool operator < (const node & o) co 阅读全文
    posted @ 2022-03-03 22:01 云憩风霞 阅读(123) 评论(0) 推荐(0) 编辑
    摘要:单调栈查找左右较大值并记录位置 反向使用同理 #define int1 long long a[n+2]//1-n存放数据,0和n+1作为边界 stack<int1> zuo,you; zuo.push(0); you.push(n+1); int1 maxz[n+2],maxy[n+2]; for 阅读全文
    posted @ 2022-03-02 22:04 云憩风霞 阅读(74) 评论(0) 推荐(0) 编辑
    摘要:线段树模板 ——更改值 typedef long long ll; const int maxn=1e6+10; //定义最大值 struct node{ ll l,r,sum,tag; } tree[maxn*4];//四倍空间保证不越界 ll a[maxn]; void pushdown(ll 阅读全文
    posted @ 2022-03-02 21:57 云憩风霞 阅读(71) 评论(0) 推荐(0) 编辑
    摘要:快读快写模板及O(2)优化 快读模板1 inline int read() { int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-') f=-1; ch=getchar(); } while(ch>='0' && ch< 阅读全文
    posted @ 2022-03-02 21:51 云憩风霞 阅读(72) 评论(0) 推荐(0) 编辑

    点击右上角即可分享
    微信分享提示