⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 money.cpp

📁 USACO chapter two.Useful for beginners.
💻 CPP
字号:
/*
ID: chenkai4
PROG: money
LANG: C++
*/
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("money.in");
ofstream out("money.out");
long long int f[10001];
int coin[26],V,N;
int main()
{
	in>>V>>N;
	for(int a=1;a<=V;a++)
		in>>coin[a];
	f[0]=1;
	for(int a=1;a<=V;a++)
		for(int b=1;b<=N;b++)
			if(coin[a]<=b) 
				f[b]+=f[b-coin[a]];
	out<<f[N]<<endl;
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -