?? inflate.cpp
字號:
/*
ID:zhjshar1
PROG:inflate
LANG:C++
*/
#include <fstream>
using namespace std;
ifstream in( "inflate.in" );
ofstream out( "inflate.out" );
int main(){
const int MAXN = 10010;
int money, totobj, f[MAXN]={0}, value, price, i, j, tem;
in >>money >>totobj;
for( i=0; i<totobj; ++i ){
in >>value >>price;
for( j=price; j<=money; ++j )
if( (tem=f[j-price]+value) > f[j] ) f[j] = tem;
}
out <<f[money] <<endl;
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -