| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 8299 | 顾顺 | 药房管理 | C++ | Compile Error | 0 | 0 MS | 0 KB | 261 | 2020-10-31 19:15:03 |
#include<bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>m>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n); int ans=0; for(int i=0;i<n;i++){ m-=a[i]; if(m<0) break; ans++; } cout<<ansl; return 0; }