Created
December 12, 2013 16:41
-
-
Save taikoubou/7931032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
typedef long long int lli; | |
void solve(int,int,int,int,int[]); | |
lli N,K,Q; | |
int memo[210][210]; | |
int main(){ | |
cin >> N >> K >> Q; | |
int m[201]; | |
solve(0,1,N-1,K,m); | |
for(int i=0;i <= N;i++){ | |
for(int j=0;j <= K;j++){ | |
cout << memo[i][j]; | |
} | |
cout << endl; | |
} | |
return 0; | |
} | |
void solve(int n,int c,int l,int m,int h[]){ | |
for(int i=n;i<=m+2+c;i++){ | |
h[c]=i; | |
if(l != c)solve(i,c+1,l,m,h); | |
else{ | |
for(int j=1;j<=l;j++)memo[n][j] = h[j]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment