跳到正文

休闲·娱乐

嘻嘻!

#SUSPENDED#约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年10月29日
收录
2025年12月12日
更新
2026年11月17日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int t;
	cin>>t;
	int sum=t;
	for(int i=1;i<=n;i++)
	{
		int x;
		cin>>x;
		if(x<=n)
		{
			sum--;
			n-=x;
		}
	}
	cout<<sum;
	return 0;
}
原文