| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 14953 | 罗炜翰 | 纪念品分组 | C++ | Compile Error | 0 | 0 MS | 0 KB | 281 | 2025-11-29 09:42:59 |
#include<bits/stdc++.h> using namespace std; int main() { int a[30010],n,w; cin>>w>>n; for(int i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n); int l=0,r=n-1,cnt=0; while(l<=r){ if(a[l]+a[r]<=w){ l++; r--; } else{ r--; } c++; } cout<<c; }