[Offer收割]编程练习赛50 register

Ended

Participants:326

Verdict:Accepted
Score:100 / 100
Submitted:2018-03-11 12:27:21

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <bits/stdc++.h>
using namespace std;
#define SZ(a) int((a).size())
#define mp make_pair
#define pb push_back
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define lrt rt<<1
#define rrt rt<<1|1
typedef vector<int> VI;
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
const LL mod=1e9+7;
const int INF=0x3f3f3f3f;
const double PI=acos(-1.0);
const double EPS=1e-6;
inline void read(LL& x){int f=1;char c;while(((c=getchar())<'0'||c>'9')&&c!='-');c=='-'?(f=-1,x=0):(x=c-'0');while((c=getchar())>='0'&&c<='9')x=x*10+c-'0';x*=f;}
inline void read(int& x){LL t;read(t);x=t;}
LL a[100005],sum[100005],mi[100005],ma[100005];
int main(){//ios_base::sync_with_stdio(0);cin.tie(0);
    int n;read(n);
    for(int i=1;i<=n;i++){
        read(a[i]);
        sum[i]=sum[i-1]+a[i];
        mi[i]=min(mi[i-1],sum[i]);
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX