Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
34162 | charlotteJ | 药房管理 | C++ | Accepted | 0 MS | 244 KB | 204 | 2023-12-16 21:37:20 |
#include<iostream> using namespace std; int main(){ int m,n,x,y=0; cin>>m>>n; for(int i=1;i<=n;i++){ cin>>x; if(m-x>0){ m=m-x; y++; }else continue; } cout<<n-y; return 0; }