上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 点击查看代码块 #include <bits/stdc++.h> using namespace std; #define ll long long const int mode=1e9+7; int n; ll k; struct Matrix{ ll a[110][110];//一定要用long 阅读全文
posted @ 2020-07-28 20:09 wsl_lld 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 #include <bits/stdc++.h> using namespace std; const int maxn=1e5+10; typedef long long ll; int n; ll a[maxn],b[maxn],c[maxn]; ll Mul = 1; ll 阅读全文
posted @ 2020-07-28 20:08 wsl_lld 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 1.线性求逆元 点击查看折叠代码块 typedef long long ll int n; int mode; ll inv[maxn]; void init(int mode){//线性求逆元 inv[0]=inv[1]=1; for (int i=2;i<maxn;i++){ inv[i] = 阅读全文
posted @ 2020-07-28 20:07 wsl_lld 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 int prim[Maxn],cnt,mu[Maxn],phi[Maxn]; bool vis[Maxn]; void Get(int n){ mu[1] = phi[1] = 1; for(int i=2;i<=n;i++) { if( !vis[i] ) prim[++cnt 阅读全文
posted @ 2020-07-28 20:03 wsl_lld 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);} void exgcd(ll a,ll b,ll &x,ll &y){ if(!b){x=1;y=0;} else{ exgcd(b,a%b,x,y); ll temp = x; x=y; y=t 阅读全文
posted @ 2020-07-28 20:02 wsl_lld 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 /* 二维树状数组+差分容斥 */ #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn=1e3+10; 阅读全文
posted @ 2020-07-28 20:00 wsl_lld 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 int lowbit(int x){ return x & -x; } void update(int x,int v){ while(x<=n){ c[x]+=v; x+=lowbit(x); } } int query(int x){ int ret=0; while(x){ 阅读全文
posted @ 2020-07-28 19:59 wsl_lld 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 /* 将某区间每一个数乘上 x 将某区间每一个数加上 x 求出某区间每一个数的和 假设区间一次方和为Sum1 现在要求区间二次方和和三次方...n次方和 设区间一次方和Sum1 = a+b+c+d+... 则区间二次方和为Sum2 = a^2+b^2+c^2+d^2+... 区间 阅读全文
posted @ 2020-07-28 19:58 wsl_lld 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 /* 矩形面积 */ #include <bits/stdc++.h> #define ed end() #define bg begin() #define mkp make_pair #define pb push_back #define v(T) vector<T> #d 阅读全文
posted @ 2020-07-28 19:56 wsl_lld 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 点击查看折叠代码块 /* 线段树维护区间最长连续子序列 */ #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn=5e4+1 阅读全文
posted @ 2020-07-28 19:55 wsl_lld 阅读(188) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页