http://codeforces.com/contest/997/problem/B
题意:有四种数字1,5,10,50 选x个数字,问和不同的有多少种
思路:看题目 没思路,打表找规律 (其实就是不会做,看看能不能猜结论)
打表发现n=11,结果为292 此后每项加49,直接暴力求出前面后面公式输出答案
#include<bits/stdc++.h>
#define fi first
#define se second
#define log2(a) log(n)/log(2)
#define show(a) cout<<a<<endl;
#define show2(a,b) cout<<a<<" "<<b<<endl;
#define show3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl;
#define tim printf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
using namespace std;
typedef long long ll;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, ll> LP;
const ll inf = 1e9+100;
const int N = 1e6 + 10;
const ll mod = 1e9+7;
const int base = 131;
const double pi = acos ( -1 );
const double eps = 1e-8;
inline ll mul(ll x,ll y) { return (x*y-(ll)((long double)x*y/mod)*mod+mod)%mod;}
inline ll ksm(ll a,ll b) {ll ans=1;while(b){if(b&1)ans=mul(ans,a);a=mul(a,a),b>>=1;}return ans;}
#define a(i,j) a[(i-1)*m+(j)]
#define b(i,j) b[(i-1)*m+(j)]
unordered_map<ll, ll> mp;
ll n, m,x,y,z,cx,k;
ll ans;
ll a[N],b[N],c[N],vis[N],num[N];
set<ll> st;
P p[N];
ll sum,cnt,flag;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
for(int x=1;x<=20;x++)
{
ans=0;
for(int i=0;i<=10000;i++) vis[i]=0;
for(int i=0;i<=x;i++)
for(int j=0;j<=x;j++)
for(int k=0;k<=x;k++)
for(int z=0;z<=x;z++)
{
y=i+5*j+10*k+50*z;
if(i+j+k+z==x&&!vis[y]) ans++,vis[y]=1;
}
num[x]=ans;
}
cin>>n;
if(n<=11) cout<<num[n];
else
{
cout<<292+(n-11)*49;
}
}