Skip to content

Create MOHAMMED AZHARUDDIN#73

Open
mdazharu wants to merge 1 commit into
highpeaksw:masterfrom
mdazharu:patch-1
Open

Create MOHAMMED AZHARUDDIN#73
mdazharu wants to merge 1 commit into
highpeaksw:masterfrom
mdazharu:patch-1

Conversation

@mdazharu

Copy link
Copy Markdown

#include <bits/stdc++.h>
using namespace std;

int func(int s,int p,int n)
{
if(p==n-1) return 1;
int ans=0;
for(int i=s;i<=9;i++)
ans+=func(i,p+1,n);

return ans;
}

int main()
{
int n,a, ans=0;
cin>>n;
vector v(n);
for(int i=0;i<n;i++)
{
cin>>a;
for(int i=0;i<=9;i++)
ans+=func(i,0,a);
}
cout<<ans;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant