标签:map tin esc desc panel fine pac -- arc
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 9239 Accepted Submission(s): 6445
#include <map> #include <set> #include <stack> #include <cmath> #include <queue> #include <cstdio> #include <vector> #include <string> #include <cstring> #include <iterator> #include <iostream> #include <algorithm> #define debug(a) cout << #a << " " << a << endl using namespace std; const int maxn = 2*1e5 + 10; const int mod = 10000; typedef long long ll; int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); ll n; cin >> n; ll a[60], b[60]; while( n -- ) { ll num; for( ll i = 0; i <= 60; i ++ ) { a[i] = b[i] = 0; } a[0] = 1; for( ll i = 1; i <= 26; i ++ ) { ll num; cin >> num; if( num == 0 ) { continue; } for( ll j = 0; j <= 50; j ++ ) { for( ll k = 0; k <= num && k*i+j <= 50; k ++ ) { b[i*k+j] += a[j]; } } for( ll j = 0; j <= 50; j ++ ) { //求出乘到现在为此出现的每项的系数 a[j] = b[j]; b[j] = 0; } } ll total = 0; for( ll i = 1; i <= 50; i ++ ) { total += a[i]; } cout << total << endl; } return 0; }
标签:map tin esc desc panel fine pac -- arc
原文地址:https://www.cnblogs.com/l609929321/p/9323164.html