Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
136816 沈梓珺 组合问题 C++ 通过 100 5 MS 256 KB 311 2024-03-09 15:25:19

Tests(12/12):


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


测评信息: