标签:额的 ++ ble int desc info shape stream put
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 15764 Accepted Submission(s): 10843
#define _CRT_SECURE_NO_DepRECATE #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <iostream> #include <cmath> #include <iomanip> #include <string> #include <algorithm> #include <bitset> #include <cstdlib> #include <cctype> #include <iterator> #include <vector> #include <cstring> #include <cassert> #include <map> #include <queue> #include <set> #include <stack> #define ll long long #define INF 0x3f3f3f3f #define ld long double const ld pi = acos(-1.0L), eps = 1e-8; int qx[4] = { 0,0,1,-1 }, qy[4] = { 1,-1,0,0 }, qxx[2] = { 1,-1 }, qyy[2] = { 1,-1 }; using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, num[20], dp[350] = { 0 }; for (int i = 1; i <= 17; i++)//先打表 { num[i] = i * i; } dp[0] = 1; for (int i = 1; i <= 17; i++)//依次计算17种面值的货币的情况 { for (int f = 1; f <= 300; f++) { if (f - num[i] < 0) { continue; } dp[f] += dp[f - num[i]];//意即f-num[i]的情况下再加一张num[i]即为f } } while (cin >> n && n) { cout << dp[n] << endl; } return 0; }
标签:额的 ++ ble int desc info shape stream put
原文地址:https://www.cnblogs.com/Load-Star/p/12655514.html