传送门 https://www.cnblogs.com/violet-acmer/p/10005351.html 题意: 给定一数组a[],从a[ ]中除去任意个元素得到b[ ],求能形成多少“好序列”: 好序列的定义是:对于任意的 i 有 b[i]%i == 0(1 ≤ i ≤ size_b[ ]). 题解: 相关变量解释: int n; int a[maxn]; int dp[maxn];//dp[i] : 下标i处可以获得的最大的"好序列" int factor[maxn];//…
C. Multiplicity 题目链接:https://codeforc.es/contest/1061/problem/C 题意: 给出一串数,问它的“好序列“有多少.好序列的定义是,首先是一个子序列(顺序可以打乱),其次,序列相应位置的数可以除尽该位置编号. 题解:这题是dp,我没有想到,主要是状态的定义. 定义dp(i,j):在a1,a2...ai中长度为j的好序列的个数,这样dp转移方程就为:if ai%j==0:  dp(i,j)=dp(i-1,j-1)+dp(i-1,j)  , e…
#include<bits/stdc++.h>using namespace std;long long a[100007];long long dp[1000007];const int mod=1e9+7;int main(){    int n;    scanf("%d",&n);    dp[0]=1;    for(int i=1;i<=n;i++)        scanf("%lld",&a[i]);    for(…
Codeforces Round #523 (Div. 2) 题目一览表 来源 考察知识点 完成时间 A Coins cf 贪心(签到题) 2018.11.23 B Views Matter cf 思维??? 2018.11.24 C Multiplicity cf dp 2018.11.27 D TV Shows cf 贪心+multiset 2018.12.2…
题目链接: http://codeforces.com/problemset/problem/213/B B. Numbers time limit per test 2 secondsmemory limit per test 256 megabytes 问题描述 Furik loves writing all sorts of problems, especially such that he can't solve himself. You've got one of his proble…
题目链接: http://codeforces.com/problemset/problem/214/B Hometask time limit per test:2 secondsmemory limit per test:256 megabytes 问题描述 Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark fo…
D. Kindergarten Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/484/D Description In a kindergarten, the children are being divided into groups. The teacher put the children in a line and associated each child wi…
A. Boredom Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/455/problem/A Description Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and d…
题目链接:https://codeforces.com/contest/1105 C. Ayoub and Lost Array 题目大意:一个长度为n的数组,数组的元素都在[L,R]之间,并且数组全部元素的和可以被3整除,问有多少种方法构建出该数组.答案模1000000007 例 输入 2 1 3 输出 3 note:满足的情况只有[1,2],[2,1],[3,3] 解题思路:用dp[i][j]表示长度为i的数组,元素大小在[L,R]之间,并且元素和模3的余数为j的方案数,我们可以计算出[L,…
https://codeforces.com/contest/1113/problem/C 题意 一个n个数字的数组a[],求有多少对l,r满足\(sum[l,mid]=sum[mid+1,r]\),sum为异或和(n<=3e5,a[i]<=2^20) 题解 异或和为零的区间可以分成任意两个区间(这两个区间的异或和相等) 定义dp[i][j]为异或和为i,下标为j(只记录奇偶)的前缀个数 枚举r,然后累加l 代码 #include<bits/stdc++.h> #define M…