| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 142043 | 吴宗桦 | 简单背包问题2 | C++ | Accepted | 100 | 117 MS | 244 KB | 492 | 2024-04-06 16:11:34 |
#include<iostream> using namespace std; int a,b,c,d[35],e[35],f,g,h,i,j,k; void aa(int x,int y) { int z=0; if(h==1) return ; if(y==k) { h=1; return ; } if(y>k) return ; for(z=x+1;z<=b;z++) { f+=1; e[f]=d[z]; aa(z,y+d[z]); if(h==1) break; else { f-=1; } } return ; } int main() { cin>>a>>b; for(c=1;c<=b;c++) cin>>d[c]; for(k=a;k>=0;k--) { h=0; aa(0,0); if(h==1) break; } cout<<a-k; return 0; }