摘要: #include<cstdio> #include<iostream> using namespace std; typedef long long ll; const int N=1000005; const int mod=998244353; int n; ll ans; int a[N],t 阅读全文
posted @ 2022-02-23 11:18 dfydn 阅读(23) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<iostream> using namespace std; const int N=1000005; int n; long long ans; char s[N]; int nxt[N]; int main(){ scanf("%d",&n); 阅读全文
posted @ 2021-11-18 23:13 dfydn 阅读(22) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<iostream> #include<cstring> using namespace std; const int N=2000005; int head[N],sum[N],ch[N<<1][2]; int cnt; int n; int to 阅读全文
posted @ 2021-11-18 21:31 dfydn 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 期望 #include<cstdio> #include<iostream> using namespace std; const int mod=1e9+7; typedef long long ll; ll w,n,k; ll ksm(ll a,ll b){ ll res=1; while(b) 阅读全文
posted @ 2021-11-18 20:47 dfydn 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 比较好的差分题目 #include<cstdio> #include<iostream> using namespace std; typedef long long ll; const int N=100005; int n; ll a[N],c[N]; ll aa,bb; int main(){ 阅读全文
posted @ 2021-11-18 17:56 dfydn 阅读(17) 评论(0) 推荐(0) 编辑
摘要: sum统计余数。如果[l,r]能被7整除,那么sum[r]和sum[l-1]的余数一定相同,然后找每个余数最前的位置和最后的位置,枚举余数统计max。 注意sum[0]=0的边界。 #include<cstdio> #include<iostream> #include<algorithm> usi 阅读全文
posted @ 2021-11-18 17:42 dfydn 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 一个比较好的性质:不可能存在不刷的情况,刷上就有可能对,所以得到递推式 #include<cstdio> #include<iostream> using namespace std; int a[55][55]; int dp[55][55][2501][2],n,ans,m,t; int mai 阅读全文
posted @ 2021-11-18 15:06 dfydn 阅读(33) 评论(0) 推荐(0) 编辑
摘要: P4670 [BalticOI 2011 Day2]Plagiarism 更改了二分的写法:将二分区间改为左闭右开的一个区间,最后答案即在L。 注意小数0.9的处理 #include<cstdio> #include<iostream> #include<algorithm> using names 阅读全文
posted @ 2021-10-23 08:03 dfydn 阅读(28) 评论(0) 推荐(0) 编辑
摘要: CF1097B Petr and a Combination Lock 设f[i][j]表示前i个操作,是否可以组成j这个角度,其中j∈[0,360),可以从f[i-1][j-a[i]]和f[i-1][j+a[i]]转移过来,每次取一下模即可。 #include<cstdio> #include<i 阅读全文
posted @ 2021-10-23 08:03 dfydn 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 同 泡泡堂 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; const int N=20005; int a[N],b[N],n; int solve(){ int ans=0; int s=1 阅读全文
posted @ 2021-10-06 01:23 dfydn 阅读(30) 评论(0) 推荐(0) 编辑