| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 136312 | 林扬泉 | 组合问题 | C++ | Presentation Error | 0 | 3 MS | 244 KB | 498 | 2024-03-09 08:36:15 |
#include<bits/stdc++.h> using namespace std; const int N=30; int m,a[N],n; bool k; void dfs(int cur){ if(cur>m){ if(k){ printf(" "); } else{ k=true; } for(int i=1;i<=m;i++){ printf("%d",a[i]); } printf("\n"); return; } for(int i=a[cur-1]+1;i<=n;i++){ //printf("%d ",i); a[cur]=i; dfs(cur+1); } } int main() { scanf("%d%d",&n,&m); dfs(1); return 0; }