随笔分类 - 题 / 算法
摘要:( •̀ ω •́ )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*
阅读全文
摘要:高效高效 分块。 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])
阅读全文
摘要:这个故事告诉我们,要全心全意赞美太阳。 题解 #include<bits/stdc++.h> using namespace std; const unsigned long long mod=998244353; struct data { int dp[3][3]; inline int* op
阅读全文
摘要:才发现蓝题以下的基本都被菜就多练的我刷掉了 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
阅读全文
摘要:布什各门,阿? 令人惊奇的题解 标程:某个姓组合的数学+高精 here
阅读全文
摘要: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
阅读全文
摘要:切水题 没有切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
阅读全文
摘要:高效高效,坚持高效,耶( •̀ ω •́ )y 首先,我们考虑引爆每个炸弹,它能引爆的区间是多少(即:它能对答案做出什么贡献) 易得炸一个=炸这个区间 为什么? 你只要引爆了一个大炸弹(例如沙皇) 它就会把它的左边和右边一起抬走 所以考虑线性维护每个炸弹向左/向右能炸到哪里 代码十分精华: #inc
阅读全文
摘要:今天有点高效啊,切数论题都这样喵? #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
阅读全文
摘要:1.逃课做法 第一眼看到: 感觉有点像内啥分解只因数 然后就不会了那我写这个干什么 这时,聪明的我们就想到了打表 怎么打呢? 如图: 我们可以把它分成几个块,提前打好每个块的答案 这样,我们就用普及的算法过了提高的题 壮观的表: 822468118437,……,3289045541824037 2.
阅读全文

浙公网安备 33010602011771号