Skip to content

Instantly share code, notes, and snippets.

@SuhasHebbar
Created February 9, 2017 08:07
Show Gist options
  • Save SuhasHebbar/3255dd01eeb39db68019896968c3f7e9 to your computer and use it in GitHub Desktop.
Save SuhasHebbar/3255dd01eeb39db68019896968c3f7e9 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
uintmax_t arr[74][74];
uintmax_t bs(int a,int b) {
uintmax_t ans=0;
for (int i = 1; i <=b; ++i)
{
if(arr[a-1][i]==0)
arr[a-1][i]=bs(a-1,i);
ans+=arr[a-1][i];
}
return ans;
}
int main() {
int t;
cin>>t;
//long long arr[t+1][t]{0};
for (int i = 0; i < t; ++i)
{
arr[1][i]=i;
}
for (int i = 0; i <= t; ++i)
{ arr[i][1]=1;
}
cout<<bs(t,t-1)<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment