摘要:
题目链接: 题意:给一个长度为n和m,k的数组,的最大值。 题解:考虑dp的做法,dp[i][j]代表以第i个数为右端点,长度减一求余m的值为j时的最大值。 转移方程:dp[i][j]=dp[i-1][j-1]+a[i](j>0) dp[i][j]=max(dp[i-1][m-1]+a[i]-k,a 阅读全文
摘要:
Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new probl 阅读全文
摘要:
题目描述 给出一个长度为N的非负整数序列Ai,对于所有1 ≤ k ≤ (N + 1) / 2,输出A1, A3, …, A2k - 1的中位数。即前1,3,5,…个数的中位数。 输入输出格式 输入格式: 第1行为一个正整数N,表示了序列长度。 第2行包含N个非负整数Ai (Ai≤109)。 输 阅读全文
摘要:
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all pl 阅读全文
摘要:
You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number 阅读全文
摘要:
链接:https://ac.nowcoder.com/acm/contest/634/C来源:牛客网 题目描述 给出一个区间[L,R],求出[L,R]中孪生质数有多少对。 由于这是一个区间筛质数的模板题。所以小k不屑于去写。 所以出题人只好yy了另一道题。 定义k生互质数为满足y + k与y - k 阅读全文
摘要:
//线段树 延迟标签 // #include <bits/stdc++.h> using namespace std; const int maxn=1e4+5; double x[maxn*4]; double y[maxn*4]; int degreen[maxn]; int d[maxn*4] 阅读全文
摘要:
链接:https://ac.nowcoder.com/acm/problem/17385来源:牛客网 题目描述 NIBGNAUK is an odd boy and his taste is strange as well. It seems to him that a positive integ 阅读全文