锘??xml version="1.0" encoding="utf-8" standalone="yes"?> Farmer Brown's cows are up in arms, having heard that McDonalds is
considering the introduction of a new product: Beef McNuggets. The
cows are trying to find any possible way to put such a product in a
negative light.
One strategy the cows are pursuing is that of `inferior packaging'.
``Look,'' say the cows, ``if you have Beef McNuggets in boxes of 3, 6,
and 10, you can not satisfy a customer who wants 1, 2, 4, 5, 7, 8, 11,
14, or 17 McNuggets. Bad packaging: bad product.''
Help the cows. Given N (the number of packaging options, 1 <= N
<= 10), and a set of N positive integers (1 <= i <= 256) that
represent the number of nuggets in the various packages, output the
largest number of nuggets that can not be purchased by buying nuggets
in the given sizes. Print 0 if all possible purchases can be made or
if there is no bound to the largest number.
The largest impossible number (if it exists) will be no larger than
2,000,000,000.
鐢╨ast璁板綍鏈灝忕殑鈥滀笉鑳界粍鎴愮殑鏁扳濄傝繖鏍峰綋last涔嬪悗鏈塨oxs[0]涓繛緇暟閮藉彲浠ョ粍鎴愮殑璇濓紝閭d箞鎵鏈夌殑鏁伴兘鍙互緇勬垚銆?br />last+1...last+box[0]鍙互緇勬垚鐨勮瘽錛岄偅涔堟瘡涓暟閮藉姞涓涓猙ox[0],閭d箞鏂頒竴杞殑box[0]涓暟涔熷彲浠ョ粍鎴愶紝浠ユ綾繪帹銆?br />
#include聽<fstream>
using聽namespace聽std;
ifstream聽fin("nuggets.in");
ofstream聽fout("nuggets.out");
#ifdef聽_DEBUG
#define聽out聽cout
#define聽in聽cin
#else
#define聽out聽fout
#define聽in聽fin
#endif
int聽box_num;
int聽boxs[10];
bool聽ok[256];
int聽gcd(int聽a,int聽b)
{
聽聽聽聽if(a<b)聽swap(a,b);
聽聽聽聽int聽tmp;
聽聽聽聽while(b!=0){
聽聽聽聽聽聽聽聽tmp聽=聽a;
聽聽聽聽聽聽聽聽a聽=聽b;
聽聽聽聽聽聽聽聽b聽=聽tmp%b;
聽聽聽聽}
聽聽聽聽return聽a;
}
void聽solve()
{
聽聽聽聽in>>box_num;
聽聽聽聽for(int聽i=0;i<box_num;++i)
聽聽聽聽聽聽聽聽in>>boxs[i];
聽聽聽聽sort(&boxs[0],&boxs[box_num]);
聽聽聽聽
聽聽聽聽int聽t聽=聽boxs[0];
聽聽聽聽for(int聽i=1;i<box_num;++i){
聽聽聽聽聽聽聽聽t聽=聽gcd(t,boxs[i]);
聽聽聽聽}
聽聽聽聽if(t!=1){
聽聽聽聽聽聽聽聽out<<0<<endl;
聽聽聽聽聽聽聽聽return;
聽聽聽聽}
聽聽聽聽memset(ok,0,sizeof(ok));
聽聽聽聽int聽last聽=聽0;
聽聽聽聽ok[0]聽=聽true;
聽聽聽聽int聽i=0;
聽聽聽聽while(true){
聽聽聽聽聽聽聽聽if(ok[i%256]){
聽聽聽聽聽聽聽聽聽聽聽聽ok[i%256]聽=聽0;
聽聽聽聽聽聽聽聽聽聽聽聽if(i-last>=boxs[0]){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out<<last<<endl;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽return;
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽for(int聽x=0;x<box_num;++x){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽ok[(i+boxs[x])%256]聽=聽true;
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽}else{
聽聽聽聽聽聽聽聽聽聽聽聽last聽=聽i;
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽++i;
聽聽聽聽}
}
int聽main(int聽argc,char聽*argv[])
{
聽聽聽聽solve();聽
聽聽聽聽return聽0;
}
Hubert ChenPROGRAM NAME: nuggets
INPUT FORMAT
Line 1: N, the number of packaging options Line 2..N+1: The number of nuggets in one kind of
box SAMPLE INPUT (file nuggets.in)
3
3
6
10OUTPUT FORMAT
The output file should contain a single line containing a single integer
that represents the largest number of nuggets that can not be represented
or 0 if all possible purchases can be made or if there is no bound to
the largest number.
SAMPLE OUTPUT (file nuggets.out)
17
]]>
銆傛墍浠ユ垜浠塪p[1][start+1][end]鍜宒p[1][start][end-1]涓皬鐨勯偅涓涓?br />濡傛灉player==1錛岄偅鍙兘琚姩鐨勭瓑0鍏堥変簡銆?鍦ㄥ墿涓嬪尯孌典腑錛屽張浣滀負(fù)鍏堥夌殑瑙掕壊錛屽嵆player0銆?br />褰撳彧鏈変竴涓暟瀛楃殑鏃跺欙紝player0灝卞彧鏈夐夎繖涓紝player1灝辨病寰楅夛紝榪斿洖0.
浠g爜濡備笅錛?br />
#include聽<fstream>
using聽namespace聽std;
ifstream聽fin("game1.in");
ofstream聽fout("game1.out");
#ifdef聽_DEBUG
#define聽out聽cout
#define聽in聽cin
#else
#define聽out聽fout
#define聽in聽fin
#endif
int聽dp[2][100][100];
int聽sequence[100];
int聽score(int聽player,int聽start,int聽end)
{
聽聽聽聽if(dp[player][start][end]!=-1)
聽聽聽聽聽聽聽聽return聽dp[player][start][end];
聽聽聽聽if(start==end){
聽聽聽聽聽聽聽聽if(player==0)
聽聽聽聽聽聽聽聽聽聽聽聽dp[player][start][end]聽=聽sequence[start];
聽聽聽聽聽聽聽聽else聽
聽聽聽聽聽聽聽聽聽聽聽聽dp[player][start][end]聽=聽0;
聽聽聽聽}else{
聽聽聽聽聽聽聽聽int聽t1聽=聽score(0,start+1,end);
聽聽聽聽聽聽聽聽int聽t2聽=聽score(0,start,end-1);
聽聽聽聽聽聽聽聽if(player==0){
聽聽聽聽聽聽聽聽聽聽聽聽if(t1>t2){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[player][start][end]聽=聽sequence[end]+score(1,start,end-1);
聽聽聽聽聽聽聽聽聽聽聽聽}else{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[player][start][end]聽=聽sequence[start]+score(1,start+1,end);
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽}else{
聽聽聽聽聽聽聽聽聽聽聽聽if(t1>t2){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[player][start][end]聽=聽score(0,start,end-1);
聽聽聽聽聽聽聽聽聽聽聽聽}else{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[player][start][end]聽=聽score(0,start+1,end);
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽}
聽聽聽聽}
聽聽聽聽return聽dp[player][start][end];
}
void聽solve()
{
聽聽聽聽memset(dp,-1,sizeof(dp));
聽聽聽聽int聽size;
聽聽聽聽in>>size;
聽聽聽聽for(int聽i=0;i<size;++i)
聽聽聽聽聽聽聽聽in>>sequence[i];
聽聽聽聽out<<score(0,0,size-1)<<"聽"<<score(1,0,size-1)<<endl;
}
int聽main(int聽argc,char聽*argv[])
{
聽聽聽聽solve();聽
聽聽聽聽return聽0;
}
]]>
#include聽<fstream>
using聽namespace聽std;
ifstream聽fin("range.in");
ofstream聽fout("range.out");
#ifdef聽_DEBUG
#define聽out聽cout
#define聽in聽cin
#else
#define聽out聽fout
#define聽in聽fin
#endif
bool聽dp[250][250];
int聽side_len;
void聽input()
{
聽聽聽聽in>>side_len;
聽聽聽聽char聽t;
聽聽聽聽for(int聽i=0;i<side_len;++i){
聽聽聽聽聽聽聽聽for(int聽j=0;j<side_len;++j){
聽聽聽聽聽聽聽聽聽聽聽聽while(聽in.get(t)&&isspace(t)聽);
聽聽聽聽聽聽聽聽聽聽聽聽dp[i][j]聽=聽t-'0';
聽聽聽聽聽聽聽聽}
聽聽聽聽}
}
void聽solve()
{
聽聽聽聽input();
聽聽聽聽for(int聽w聽=聽2;w<=side_len;++w){
聽聽聽聽聽聽聽聽int聽cnt聽=聽0;
聽聽聽聽聽聽聽聽for(int聽i=0;i<side_len;++i){
聽聽聽聽聽聽聽聽聽聽聽聽for(int聽j=0;j<side_len;++j){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(i+w<=side_len&&j+w<=side_len){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i][j]聽=聽dp[i][j]&&dp[i+1][j]&&dp[i][j+1]&&dp[i+1][j+1];
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(dp[i][j])
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cnt++;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽if(cnt!=0){
聽聽聽聽聽聽聽聽聽聽聽聽out<<w<<"聽"<<cnt<<endl;
聽聽聽聽聽聽聽聽}
聽聽聽聽}
}
int聽main(int聽argc,char聽*argv[])
{
聽聽聽聽solve();聽
聽聽聽聽return聽0;
}
]]>
dp[i][j][k][m][n] = min ( dp[i][j][k][m][n], dp[i-o[0]][j-o[1]][k-o[2]][m-o[3]][n-o[4]]+offer.cost);
analysis涓彁鍑虹敤鏈鐭礬寰勭殑鏂規(guī)硶鏉ヨВ錛屾濊礬寰堝閥濡欍傛妸鈥濊鏈変笉鍚岀鏁板拰鏁伴噺鐨勭墿鍝佲滅殑綃瓙鐪嬩綔緇撶偣錛屾妸offer浣滀負(fù)杈?鎶婅喘涔頒竴浠剁墿鍝佺殑鍘熷浠鋒牸鐪嬫垚涓縐嶉鍖栫殑offer)錛屾妸浠鋒牸浣滀負(fù)杈歸暱搴︺傝繖鏍峰氨杞崲鎴愪粠綃瓙(0,0,0,0,0)鍒版墍姹傜粨鐐圭殑鏈鐭礬寰勯棶棰樸?br />
浠g爜濡備笅:
#include聽<fstream>
using聽namespace聽std;
ifstream聽fin("shopping.in");
ofstream聽fout("shopping.out");
#ifdef聽_DEBUG
#define聽out聽cout
#define聽in聽cin
#else
#define聽out聽fout
#define聽in聽fin
#endif
int聽dp[6][6][6][6][6];
struct聽offer{
聽聽聽聽int聽pro_num;
聽聽聽聽int聽price;
聽聽聽聽int聽product[5];
聽聽聽聽int聽amount[5];
};
int聽offer_num;
offer聽offers[100];
int聽map[1000]; //product id鍒扳濇寜鐗╁搧鍑虹幇欏哄簭鎵緇欑殑緙栧彿鈥滅殑鏄犲皠
int聽price[1000];//product id瀵瑰簲鐨勭墿鍝佷環(huán)鏍?br />int聽product_num;//鐗╁搧鎬繪暟鐩?br />int聽products[5];//瀛樻斁product id
int聽amount[5];//product 鎵闇鐨勬暟閲?br />
void聽solve()
{
聽聽聽聽in>>offer_num;
聽聽聽聽for(int聽i=0;i<offer_num;++i){
聽聽聽聽聽聽聽聽in>>offers[i].pro_num;
聽聽聽聽聽聽聽聽for(int聽j=0;j<offers[i].pro_num;++j){
聽聽聽聽聽聽聽聽聽聽聽聽in>>offers[i].product[j]>>offers[i].amount[j];
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽in>>offers[i].price;
聽聽聽聽}
聽聽聽聽
聽聽聽聽int聽pro_idx聽=聽0;
聽聽聽聽in>>product_num;
聽聽聽聽for(int聽i=0;i<product_num;++i){
聽聽聽聽聽聽聽聽in>>products[i];
聽聽聽聽聽聽聽聽in>>amount[i];
聽聽聽聽聽聽聽聽in>>price[i];
聽聽聽聽聽聽聽聽map[聽products[i]聽]聽=聽i;
聽聽聽聽}
聽聽聽 //娌℃湁鎶樻墸鏃剁殑浠鋒牸
聽聽聽聽for(int聽i=0;i<=5;++i)
聽聽聽聽聽聽聽聽for(int聽j=0;j<=5;++j)
聽聽聽聽聽聽聽聽聽聽聽聽for(int聽k=0;k<=5;++k)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽m=0;m<=5;++m)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽n=0;n<=5;++n){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i][j][k][m][n]聽=聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[0]*i+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[1]*j+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[2]*k+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[3]*m+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[4]*n;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽for(int聽i=0;i<=5;++i)
聽聽聽聽聽聽聽聽for(int聽j=0;j<=5;++j)
聽聽聽聽聽聽聽聽聽聽聽聽for(int聽k=0;k<=5;++k)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽m=0;m<=5;++m)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽n=0;n<=5;++n){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽tmp[5];
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽s=0;s<offer_num;++s){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽memset(tmp,0,sizeof(tmp));聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽t=0;t<offers[s].pro_num;++t){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽tmp[map[offers[s].product[t]]]聽=聽offers[s].amount[t];
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(i>=tmp[0]&&j>=tmp[1]&&k>=tmp[2]&&m>=tmp[3]&&n>=tmp[4]){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i][j][k][m][n]聽=聽min(聽dp[i][j][k][m][n],
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i-tmp[0]][j-tmp[1]][k-tmp[2]][m-tmp[3]][n-tmp[4]]+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽offers[s].price);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽out<<dp[amount[0]][amount[1]][amount[2]][amount[3]][amount[4]]<<endl;
}
int聽main(int聽argc,char聽*argv[])
{
聽聽聽聽solve();聽
聽聽聽聽return聽0;
}
涓婇潰浠g爜鏈変釜涓ラ噸鐨刡ug錛岃阿璋㈢綉鍙嬧滄垜涔熷噾鐑椆"鎸囧嚭銆傜敱浜巑ap鎵鏈夊奸兘涓?銆傛墍浠ユ湭鍦ㄥ晢鍝佸垪琛ㄤ腑鍑虹幇鐨勫晢鍝佺殑map鍊奸兘涓?錛屽嵆閮芥槧灝勪負(fù)絎竴涓晢鍝併傜幇鏀規(guī)垚灝唌ap鍒濆鍖栦負(fù)-1錛屽茍澧炲姞鍒ゆ柇璇彞銆傛澶栧皢鍒濆鍖杁p鐨勮鍙ュ悎騫跺埌鍚庨潰錛屼互綆鍖栦唬鐮併?br />
#include聽<fstream>
using聽namespace聽std;
ifstream聽fin("shopping.in");
ofstream聽fout("shopping.out");
#ifdef聽_DEBUG
#define聽out聽cout
#define聽in聽cin
#else
#define聽out聽fout
#define聽in聽fin
#endif
int聽dp[6][6][6][6][6];
struct聽offer{
聽聽聽聽int聽pro_num;
聽聽聽聽int聽price;
聽聽聽聽int聽product[5];
聽聽聽聽int聽amount[5];
};
int聽offer_num;
offer聽offers[100];
int聽map[1000];
int聽price[1000];
int聽product_num;
int聽products[5];
int聽amount[5];
void聽solve()
{
聽聽聽聽in>>offer_num;
聽聽聽聽for(int聽i=0;i<offer_num;++i){
聽聽聽聽聽聽聽聽in>>offers[i].pro_num;
聽聽聽聽聽聽聽聽for(int聽j=0;j<offers[i].pro_num;++j){
聽聽聽聽聽聽聽聽聽聽聽聽in>>offers[i].product[j]>>offers[i].amount[j];
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽in>>offers[i].price;
聽聽聽聽}
聽聽聽聽
聽聽聽聽int聽pro_idx聽=聽0;
聽聽聽聽in>>product_num;
聽聽聽聽//2009.07.27淇敼
聽聽聽聽memset(map,-1,sizeof(map));
聽聽聽聽for(int聽i=0;i<product_num;++i){
聽聽聽聽聽聽聽聽in>>products[i];
聽聽聽聽聽聽聽聽in>>amount[i];
聽聽聽聽聽聽聽聽in>>price[i];
聽聽聽聽聽聽聽聽map[聽products[i]聽]聽=聽i;
聽聽聽聽}
聽聽聽聽for(int聽i=0;i<=5;++i)
聽聽聽聽聽聽聽聽for(int聽j=0;j<=5;++j)
聽聽聽聽聽聽聽聽聽聽聽聽for(int聽k=0;k<=5;++k)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽m=0;m<=5;++m)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽n=0;n<=5;++n){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i][j][k][m][n]聽=聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[0]*i+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[1]*j+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[2]*k+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[3]*m+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽price[4]*n;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽tmp[5];
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽s=0;s<offer_num;++s){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽memset(tmp,0,sizeof(tmp));聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽for(int聽t=0;t<offers[s].pro_num;++t){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//2009.07.27淇敼
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(聽map[offers[s].product[t]]!=-1)
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽tmp[map[offers[s].product[t]]]聽=聽offers[s].amount[t];
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(i>=tmp[0]&&j>=tmp[1]&&k>=tmp[2]&&m>=tmp[3]&&n>=tmp[4]){
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i][j][k][m][n]聽=聽min(聽dp[i][j][k][m][n],
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽dp[i-tmp[0]][j-tmp[1]][k-tmp[2]][m-tmp[3]][n-tmp[4]]+
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽offers[s].price);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽out<<dp[amount[0]][amount[1]][amount[2]][amount[3]][amount[4]]<<endl;
}
int聽main(int聽argc,char聽*argv[])
{
聽聽聽聽solve();聽
聽聽聽聽return聽0;
}
]]>
]]>
]]>
]]>
]]>
]]>