Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
21242 李正谦 从前M个字母中任取N个的组合 C++ Accepted 100 0 MS 248 KB 314 2021-06-26 20:09:57

Tests(4/4):


#include<bits/stdc++.h> using namespace std; int m,n,a[101]; void dfs(int k,int l){ int i,j; if(k>n){ for(j=1;j<=n;j++) cout<<char(a[j]+64); cout<<endl; return; } for(i=l+1;i<=m+k-n;i++){ a[k]=i; dfs(k+1,i); } } int main(){ cin>>m>>n; dfs(1,0); return 0; }


Judgement Protocol: