当前位置:网站首页>Contest3147 - game 38 of 2021 Freshmen's personal training match_ E: Listen to songs and know music
Contest3147 - game 38 of 2021 Freshmen's personal training match_ E: Listen to songs and know music
2022-07-02 06:06:00 【This question AC sleep again】
//
#include<bits/stdc++.h>
using namespace std;
// 1e5*1e3=1e8 < int
const int N=1e5+6;
const int A=1111;
int a[N];
int main()
{
int n,t,i,temp;
while( ~scanf("%d%d",&n,&t) )
{
temp=0;
memset( a,0,sizeof( a ) );
for( i=1;i<=n;i++ ) scanf("%d",&a[i]);
for( i=1;i<=n;i++ )
{
if( temp+a[i]<t ) temp+=a[i]; // Anticipation < No =
else break;
}
printf("%d\n",i);
}
return 0;
}
//
find:
01 Predict not to take, etc
eg.
3 5
5 5 5
边栏推荐
- Google Go to sea entrepreneurship accelerator registration countdown 3 days, entrepreneurs pass through the guide in advance collection!
- Error creating bean with name 'instanceoperatorclientimpl' defined in URL when Nacos starts
- Vscode paste image plugin saves image path settings
- Stc8h8k series assembly and C51 actual combat - keys allow key counting (using falling edge interrupt control)
- Software testing - concept
- 图片裁剪插件cropper.js
- [C language] screening method for prime numbers
- php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
- Go 学习笔记整合
- 让每一位开发者皆可使用机器学习技术
猜你喜欢
Software testing - concept
Introduce uview into uni app
如何使用MITMPROXy
Google Go to sea entrepreneurship accelerator registration countdown 3 days, entrepreneurs pass through the guide in advance collection!
神机百炼3.52-Prim
网络相关知识(硬件工程师)
Can't the dist packaged by vite be opened directly in the browser
Test case
[PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法
CNN可视化技术 -- CAM & Grad-CAM详解及pytorch简洁实现
随机推荐
Can't the dist packaged by vite be opened directly in the browser
MUI底部导航的样式修改
php内类名称与类内方法名相同
浏览器原理思维导图
Problems encountered in uni app development (continuous update)
Redis key value database [primary]
步骤详解 | 助您轻松提交 Google Play 数据安全表单
Use some common functions of hbuilderx
Deep learning classification network -- vggnet
Jetpack Compose 与 Material You 常见问题解答
Format check JS
servlet的web.xml配置详解(3.0)
深度学习分类网络--VGGNet
Leverage Google cloud infrastructure and landing area to build enterprise level cloud native excellent operation capability
Google play academy team PK competition, official start!
cookie插件和localForage离线储存插件
Software testing - concept
CNN可视化技术 -- CAM & Grad-CAM详解及pytorch简洁实现
Generics and generic constraints of typescript
Sumo tutorial Hello World