Ellison_Z @ 2023-05-24 20:56:31
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,p,stu[5000005];
cin>>n>>p;
for(int i=1;i<=n;i++)
cin>>stu[i];
for(int i=1;i<=p;i++)
{
int a,b,c;
cin>>a>>b>>c;
for(int j=a;j<=b;j++)
{
stu[j]+=c;
}
}
sort(stu,stu+n);
cout<<stu[1];
}
样例超时
by Ellison_Z @ 2023-05-24 20:58:37
小短码肯定过不了QwQ
by hedabo_2445 @ 2023-05-24 21:16:13
@Ellison_Z 这个纯暴力,时间复杂度
建议用
记录
by Ellison_Z @ 2023-05-24 21:17:31
ty
happy!