最后两个WA 求助

P2367 语文成绩

fzj2007 @ 2019-08-10 21:33:20

// luogu-judger-enable-o2
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<stack>
#include<queue>
#include<math.h>
#include<time.h>
#include<cstdio>
#include<stdio.h>
#include<algorithm>
using namespace std;
int n,m,x,y,z;
int p[10001];
int main(){
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++) scanf("%d",&p[i]);
    for(int i=1;i<=m;i++){
        scanf("%d %d %d",&x,&y,&z);
        for(int i=x;i<=y;i++) p[i]+=z;
    }
    sort(p+1,p+n+1);
    cout<<p[1];
    return 0;
}

by Ln_YJIn @ 2019-08-10 21:43:36

对于80%的数据,有n<=100000

对于100%的数据,有n<=5000000,p<=n,学生初始成绩<=100,z<=100

int p[10001];

wtf??


by 飞风追云 @ 2020-08-12 10:01:08

这问题也是很奇怪


by 飞风追云 @ 2020-08-12 10:01:46

被头文件秀到


|