| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 8354 | 李思贤 | 药房管理 | C++ | Accepted | 100 | 0 MS | 248 KB | 255 | 2020-10-31 19:43:00 |
#include<bits/stdc++.h> using namespace std; int main(){ int m,n[101],man=0; cin>>m>>man; for(int i=1;i<=man;i++){ cin>>n[i]; } int i=1,y=man; while(m&&man&&i<=y){ if(m-n[i]>=0){ man--; m-=n[i]; } i++; } cout<<man; }