题面:P2925 [USACO08DEC]干草出售Hay For Sale 题解:无 代码: #include<cstdio> #include<cstring> #include<iostream> using namespace std; ,maxh=; int C,H,V[maxh]; bool F[maxc]; int main(){ scanf("%d%d",&C,&H); ;i<=H;i++)scanf("…
-------------------------------------------------------------------- #include<cstdio> #include<algorithm> #include<iostream> #include<cstring> #define rep( i , n ) for( int i = 0 ; i < n ; ++i ) #define clr( x , c ) memset( x…
[题目描述:] 约翰遭受了重大的损失:蟑螂吃掉了他所有的干草,留下一群饥饿的牛.他乘着容量为C(1≤C≤50000)个单位的马车,去顿因家买一些干草. 顿因有H(1≤H≤5000)包干草,每一包都有它的体积Vi(l≤Vi≤C).约翰只能整包购买, 他最多可以运回多少体积的干草呢? [输入格式:] Line 1: Two space-separated integers: C and H Lines 2..H+1: Each line describes the volume of a singl…