#include <iostream> #include <cstdio> #include <algorithm> using namespace std; typedef long long LL; ; ; LL a[MAXN], sum[MAXN], ans[MAXN]; int main() { int n, m; while(cin>>n>>m) { ; i<=n; i++) scanf("%lld",&…
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; typedef long long LL; const int MAXN = 1e4+5; const LL INF = 1e15+5; LL a[MAXN], sum[MAXN], ans[MAXN]; int main() { int n, m; while(cin>>n>>m) {…
题目链接:51nod 1065 最小正子段和 房教说用前缀和做,然后看了别人博客懂了后就感觉,这个真有意思... #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; const int inf = 0x3f3f3f3f; pair<long long, int> sum[N]; int a[N]; int n; int main(){ int i, j;…