编程部分
前面的选择题忘了
T1 零件组装 思路用桶排思想存一下,然后取最小的零件个数
代码#include
using namespace std;
int a[5],cnt[5];
int main()
{
for(int i = 0;i >a[i];
int temp;
int ans = 0x3f3f3f3f;
for(int i = 0;i temp;
if(temp >= a[4]) cnt[i]++;
}
ans = min(ans,cnt[i]);
}
cout>k;
for(int i = 1;i >a[i];
memset(f,0x3f,sizeof f);
f[0] = f[1] = 0;
for(int i = 1;i a[i];
map vis;
int ans = 0;
for(int i = 1;i
关注
打赏