提交时间:2024-10-18 15:09:30

运行 ID: 53076

#include<bits/stdc++.h> using namespace std; int main() { int all, wawawa = 0, n; cin >> all >> n; for(int i=1;i<=n;i++){ int wanted; cin>>wanted; if(all < wanted){ wawawa+=1; }else{ all -= wanted; } } cout<<wawawa; return 0; }