delete pics to save space
This commit is contained in:
15
1.1181.cpp
Normal file
15
1.1181.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
// luogu-judger-enable-o2
|
||||
#include<cstdio>
|
||||
int n,m,res=1,now,x;
|
||||
int main()
|
||||
{
|
||||
scanf("%d%d",&n,&m);
|
||||
for(int i=0;i<n;i++)
|
||||
{
|
||||
scanf("%d",&x);
|
||||
if(now+x>m) res++,now=x;
|
||||
else now+=x;
|
||||
}
|
||||
printf("%d\n",res);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user