摘要: 给定一个长度为 N的数列,A1,A2,...An,如果其中一段连续的子序列 Ai,Ai+1,…AjAi,Ai+1,…Aj 之和是 KK 的倍数,我们就称这个区间 [i,j][i,j] 是 KK 倍区间。 你能求出数列中总共有多少个 KK 倍区间吗? 输入格式 第一行包含两个整数 NN 和 KK。 以 阅读全文
posted @ 2021-05-21 14:47 Acception 阅读(145) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long; int fan(int n){ for(ll i=n-1;i>=0;i--){ n&=i; if(n==0){ return i; } } } inline int 阅读全文
posted @ 2021-05-21 00:46 Acception 阅读(34) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; using ll = long long; const int maxn=1e5+10; vector<pair<int,int>>g[maxn]; int d1[maxn],d2[maxn]; int p1 阅读全文
posted @ 2021-05-20 18:08 Acception 阅读(35) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int maxn=1e4+10; vector<pair<int,int>>g[maxn]; int d1[maxn],d2[maxn]; void dfs(int u,int fa){ for( 阅读全文
posted @ 2021-05-20 17:50 Acception 阅读(47) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int N = 55, M = 35; int n; int w[N]; int dp[N][N][M]; void add(int a[],int b[]){ int t=0; for(int 阅读全文
posted @ 2021-05-20 09:00 Acception 阅读(107) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; using ll = long long; const int maxn=1e6+10; int n,k,a[maxn],q[maxn]; int main(){ ios::sync_with_stdio(false) 阅读全文
posted @ 2021-05-19 11:54 Acception 阅读(29) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; const int maxn=100005; int a[maxn],dp[maxn]; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) scanf( 阅读全文
posted @ 2021-05-18 10:08 Acception 阅读(37) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; char a[1005],b[1995]; int dp[1005][1005]; int main() { int n,m; cin>>n>>m>>(a+1)>>(b+1); for(int i=1;i<=n;i++ 阅读全文
posted @ 2021-05-18 10:05 Acception 阅读(26) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstring> #include <cmath> using namespace std; using ll=long long ; const int maxn=1e3+10; const int mod=1e6+3; int dp[m 阅读全文
posted @ 2021-05-17 19:14 Acception 阅读(191) 评论(0) 推荐(0)
摘要: #include <cstring> #include <cstdio> #define max(a,b) a>b?a:b const int mn=300005; struct Trie{ int father,fail,next[26]; void init(){ father=fail=0; 阅读全文
posted @ 2021-05-17 17:42 Acception 阅读(502) 评论(0) 推荐(0)