Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
136777 | 苏唯哲 | 组合问题 | C++ | 通过 | 100 | 4 MS | 240 KB | 293 | 2024-03-09 15:08:51 |
#include<bits/stdc++.h> using namespace std; int n,m,a[25]; void dfs(int step){ if(step==m+1){ for(int i=1;i<=m;i++){ cout<<a[i]; } cout<<endl; }else{ a[step]=a[step-1]+1; for(;a[step]<=n;a[step]++){ dfs(step+1); } } } int main(){ cin>>n>>m; dfs(1); }