开始 2026-05-12 00:00:00

上虞编程比赛

结束 2026-05-28 00:00:00
Contest is over.
当前 2026-06-10 09:14:23

d

include<bits/stdc++.h>

using namespace std; int a[100005]; int main(){

int n,t,s=0;
cin>>n>>t;
for(int i=1;i<=n;i++){
	cin>>a[i];
}
for(int i=1;i<=n;i++){
	s+=a[i];
	if(s>=t){
		cout<<i;
		return 0;
	}
}
return 0;

}


admin_hzf  •  28天前

比赛已结束。