问题简述
给出一段序列,选出其中连续且非空的一段使得这段和最大。
代码
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <cmath>
using namespace std;
int s[10000055];
int main(){
int ans=0,b=0,maxn=0;
int n;
scanf("%d",&n);
for
给出一段序列,选出其中连续且非空的一段使得这段和最大。
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <cmath>
using namespace std;
int s[10000055];
int main(){
int ans=0,b=0,maxn=0;
int n;
scanf("%d",&n);
for