摘要: 小b喜欢和为K的倍数的序列。 现在有一个长度为n的序列A,请问A有多少个非空连续子序列是小b喜欢的。 cpp include include include include include include using namespace std; const int N=3e4+10; int a[ 阅读全文
posted @ 2019-10-15 20:08 白木偶君 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 有两个长度为n的序列A,B,你需要重排列A,使得满足A[i] B[i]的i的数目尽量大。 只需输出这个最大个数即可。 没想到可以直接贪心.. cpp include include include include include include define int long long using 阅读全文
posted @ 2019-10-15 19:58 白木偶君 阅读(156) 评论(0) 推荐(0) 编辑
摘要: N个整数组成的序列a[1],a[2],a[3],…,a[n],从中选出一个子段(a[i],a[i+1],…a[j]),使这个子段的和 0,并且这个和是所有和 0的子序列中最小的。 例如:4, 1,5, 2, 1,2,6, 2。 1,5, 2, 1,序列和为1,是最小的。 输入 第1行:整数序列的长度 阅读全文
posted @ 2019-10-15 09:32 白木偶君 阅读(158) 评论(0) 推荐(0) 编辑