| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 20930 | 季洁 | 从前M个字母中任取N个的组合 | C++ | Accepted | 100 | 0 MS | 256 KB | 330 | 2021-06-22 16:36:32 |
#include<bits/stdc++.h> using namespace std; int n,m,a[11]; void check(int x,int y,int l){ if(y){ l++; for(int i=a[l-1]+1;i<=x-y+1;i++){ a[l]=i; check(x,y-1,l); } }else{ for(int i=1;i<=l;i++){ cout<<(char)(a[i]+64); } cout<<endl; } } int main(){ cin>>n>>m; check(n,m,0); return 0; }